-
Notifications
You must be signed in to change notification settings - Fork 1
/
aiutp_sup.erl
29 lines (25 loc) · 860 Bytes
/
aiutp_sup.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
-module(aiutp_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
SupFlags = #{strategy => one_for_all,
intensity => 1,
period => 5},
SocketSup = #{id => aiutp_socket_sup,
start => {aiutp_socket_sup,start_link,[]},
restart => transient,
shutdown => 5000,
type => supervisor,
modules => [aiutp_socket_sup]
},
WorkerSup = #{id => aiutp_woker_sup,
start => {aiutp_worker_sup,start_link,[]},
restart => transient,
shutdown => 5000,
type => supervisor,
modules => [aiutp_worker_sup]
},
{ok, {SupFlags, [SocketSup,WorkerSup]}}.