lecture 07
This commit is contained in:
7 files changed
+165
No files matched your search
@@ -0,0 +1,14 @@
|
||||
-module(counter_supervisor).
|
||||
-behaviour(supervisor).
|
||||
-export([start_link/0, init/1]).
|
||||
-define(TABLE, counter_table).
|
||||
|
||||
start_link() ->
|
||||
ets:new(?TABLE, [named_table, public]),
|
||||
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||
|
||||
init(_) ->
|
||||
Flags = #{strategy => one_for_one},
|
||||
ChildSpecs = [#{id => worker1,
|
||||
staart => {counter_worker, start_link, [0]}}],
|
||||
{ok, {Flags, ChildSpecs}}.
|
||||
Reference in new issue
Block a user