./ct_report/coverage/mongoose_listener_sup.COVER.html

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 -include("mongoose_logger.hrl").
12
13 %% API
14
15 -spec start_link() -> {ok, pid()}.
16 start_link() ->
17 42 supervisor:start_link({local, ?MODULE}, ?MODULE, []).
18
19 -spec start_child(supervisor:child_spec()) -> ok.
20 start_child(ChildSpec) ->
21 %% Use ejabberd_sup function for extra logging on errors
22 599 ejabberd_sup:start_child(?MODULE, ChildSpec),
23 599 ok.
24
25 %% Supervisor callbacks
26
27 -spec init([]) -> {ok, {supervisor:sup_flags(), []}}.
28 init([]) ->
29 42 {ok, {#{strategy => one_for_one,
30 intensity => 10,
31 period => 1}, []}}.
Line Hits Source