Current section
Files
Jump to
Current section
Files
src/h1_sup.erl
%% Copyright (c) 2026 Benoit Chesneau.
%% SPDX-License-Identifier: Apache-2.0
%%
-module(h1_sup).
-behaviour(supervisor).
-export([start_link/0, start_listener/1]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
start_listener(Args) ->
supervisor:start_child(?MODULE, [Args]).
init([]) ->
SupFlags = #{strategy => simple_one_for_one,
intensity => 10,
period => 10},
Child = #{id => h1_listener,
start => {h1_listener, start_link, []},
restart => temporary,
shutdown => 5000,
type => worker,
modules => [h1_listener]},
{ok, {SupFlags, [Child]}}.