-
Notifications
You must be signed in to change notification settings - Fork 0
/
dtls_worker_sup.erl
38 lines (31 loc) · 1.21 KB
/
dtls_worker_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
30
31
32
33
34
35
36
37
38
-module(dtls_worker_sup).
-behaviour(supervisor).
-mode(compile).
-compile(export_all).
-include("../logger.hrl").
%%====================================================================
%% API functions
%%====================================================================
start_link(#{}=State) ->
(supervisor:start_link({local, ?MODULE}, ?MODULE, State)).
start_child(#{}=State) ->
(supervisor:start_child(?MODULE, [State])).
terminate_child(PID) ->
(supervisor:terminate_child(?MODULE, PID)).
%%====================================================================
%% Behaviour callbacks
%%====================================================================
init(#{}=State) ->
Children = [
#{id => dtls_worker,
start => {dtls_worker, start_link, [State]},
restart => temporary,
shutdown => brutal_kill,
type => worker,
modules => [dtls_worker]
}
],
({ok, {{simple_one_for_one, 0, 1}, Children}}).
%%====================================================================
%% Internal functions
%%====================================================================