aboutsummaryrefslogtreecommitdiff
path: root/apps/dreki/src/dreki_sup.erl
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dreki/src/dreki_sup.erl')
-rw-r--r--apps/dreki/src/dreki_sup.erl39
1 files changed, 39 insertions, 0 deletions
diff --git a/apps/dreki/src/dreki_sup.erl b/apps/dreki/src/dreki_sup.erl
new file mode 100644
index 0000000..c1aa636
--- /dev/null
+++ b/apps/dreki/src/dreki_sup.erl
@@ -0,0 +1,39 @@
+%%%-------------------------------------------------------------------
+%% @doc dreki top level supervisor.
+%% @end
+%%%-------------------------------------------------------------------
+
+-module(dreki_sup).
+
+-behaviour(supervisor).
+
+-export([start_link/0]).
+
+-export([init/1]).
+
+-define(SERVER, ?MODULE).
+
+start_link() ->
+ supervisor:start_link({local, ?SERVER}, ?MODULE, []).
+
+%% sup_flags() = #{strategy => strategy(), % optional
+%% intensity => non_neg_integer(), % optional
+%% period => pos_integer()} % optional
+%% child_spec() = #{id => child_id(), % mandatory
+%% start => mfargs(), % mandatory
+%% restart => restart(), % optional
+%% shutdown => shutdown(), % optional
+%% type => worker(), % optional
+%% modules => modules()} % optional
+init([]) ->
+ SupFlags = #{strategy => one_for_all,
+ intensity => 10,
+ period => 5},
+ ChildSpecs = [
+ #{id => dreki_event_manager, start => {dreki_event_manager, start_link, [[]]}},
+ #{id => dreki_world_server, start => {dreki_world_server, start_link, [[]]}},
+ #{id => dreki_node_server, start => {dreki_node_server, start_link, [[]]}}
+ ],
+ {ok, {SupFlags, ChildSpecs}}.
+
+%% internal functions