Current section
Files
Jump to
Current section
Files
lib/pollution_supervisor.erl
%%%-------------------------------------------------------------------
%%% @author Arkadiusz
%%% @copyright (C) 2021, <COMPANY>
%%% @doc
%%% @end
%%%-------------------------------------------------------------------
-module(pollution_supervisor).
-behaviour(supervisor).
-export([start_link/0, init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, [])
%%unlink(whereis(?MODULE))
.
init([]) ->
AChild = #{id => 'pol_server',
start => {pollution_gen_server, start_link, []},
restart => permanent,
shutdown => 2000,
type => worker,
modules => [pollution_gen_server]},
BChild = #{id => 'pol_state_machine',
start => {pollution_value_collector_gen_statem, start_link, []},
restart => permanent,
shutdown => 2000,
type => worker,
modules => [pollution_value_collector_gen_statem]},
{ok, {#{strategy => one_for_one,
intensity => 2,
period => 3},
[AChild, BChild]}
}.