1 |
|
%% @doc Supervisor for the socket listeners |
2 |
|
|
3 |
|
-module(mongoose_listener_sup). |
4 |
|
|
5 |
|
-behaviour(supervisor). |
6 |
|
|
7 |
|
-export([start_link/0, start_child/1, init/1]). |
8 |
|
|
9 |
|
-ignore_xref([start_link/0, init/1]). |
10 |
|
|
11 |
|
%% API |
12 |
|
|
13 |
|
-spec start_link() -> {ok, pid()}. |
14 |
|
start_link() -> |
15 |
76 |
supervisor:start_link({local, ?MODULE}, ?MODULE, []). |
16 |
|
|
17 |
|
-spec start_child(supervisor:child_spec()) -> ok. |
18 |
|
start_child(ChildSpec) -> |
19 |
988 |
{ok, _Pid} = supervisor:start_child(?MODULE, ChildSpec), |
20 |
988 |
ok. |
21 |
|
|
22 |
|
%% Supervisor callbacks |
23 |
|
|
24 |
|
-spec init([]) -> {ok, {supervisor:sup_flags(), []}}. |
25 |
|
init([]) -> |
26 |
76 |
{ok, {#{strategy => one_for_one, |
27 |
|
intensity => 10, |
28 |
|
period => 1}, []}}. |