Current section
Files
Jump to
Current section
Files
src/samples/processes/dummy_butler_server_sup.erl
-module(dummy_butler_server_sup).
-behaviour(supervisor).
-export([start_link/4]).
-export([init/1]).
start_link(BId, ButlerLocation, RId, RackLocation) ->
supervisor:start_link(dummy_butler_server_sup, [BId, ButlerLocation, RId, RackLocation]).
init([BId, ButlerLocation, RId, RackLocation]) ->
SupFlags = #{strategy => one_for_one, intensity => 1, period => 5},
ChildSpecs = [#{id => dummy_navigator,
start => {dummy_navigator, start_link, [BId, ButlerLocation]},
restart => permanent,
shutdown => brutal_kill,
type => worker,
modules => [dummy_navigator]},
#{id => dummy_rack_location_service,
start => {dummy_rack_location_service, start_link, [RId, RackLocation]},
restart => permanent,
shutdown => brutal_kill,
type => worker,
modules => [dummy_rack_location_service]}
],
{ok, {SupFlags, ChildSpecs}}.