File size: 763 Bytes
1540772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
%%%-------------------------------------------------------------------
%%% @doc Supervises the HTTP/WebSocket API layer.
%%% @end
%%%-------------------------------------------------------------------
-module(hk_api_sup).
-behaviour(supervisor).

-export([start_link/0, init/1]).

start_link() ->
    hk_sup_util:start_link_retry(
        fun() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []) end).

init([]) ->
    SupFlags = #{strategy => one_for_one, intensity => 10, period => 10},
    Children = [
        #{id => hk_api_listener,
          start => {hk_api_listener, start_link, []},
          restart => permanent,
          shutdown => 5000,
          type => worker,
          modules => [hk_api_listener]}
    ],
    {ok, {SupFlags, Children}}.