summaryrefslogtreecommitdiff
path: root/src/mem3_sup.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem3_sup.erl')
-rw-r--r--src/mem3_sup.erl22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mem3_sup.erl b/src/mem3_sup.erl
new file mode 100644
index 00000000..122e68d7
--- /dev/null
+++ b/src/mem3_sup.erl
@@ -0,0 +1,22 @@
+-module(mem3_sup).
+-behaviour(supervisor).
+-export([start_link/0, init/1]).
+
+start_link() ->
+ supervisor:start_link(?MODULE, []).
+
+init(_Args) ->
+ Children = [
+ child(mem3_server),
+ child(mem3_event),
+ child(mem3_sync),
+ child(mem3_cache)
+ ],
+ {ok, {{one_for_one,10,1}, Children}}.
+
+child(mem3_event) ->
+ MFA = {gen_event, start_link, [{local,mem3_event}]},
+ {mem3_event, MFA, permanent, 1000, worker, dynamic};
+child(Child) ->
+ {Child, {Child, start_link, []}, permanent, 1000, worker, [Child]}.
+ \ No newline at end of file