diff options
Diffstat (limited to 'src/ss7MAPer_sup.erl')
-rw-r--r-- | src/ss7MAPer_sup.erl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ss7MAPer_sup.erl b/src/ss7MAPer_sup.erl new file mode 100644 index 0000000..915effc --- /dev/null +++ b/src/ss7MAPer_sup.erl @@ -0,0 +1,34 @@ +-module(ss7MAPer_sup). +-author('Daniel Mende <mail@c0decafe.de>'). + +-behaviour(supervisor). + +%% API +-export([start_link/1]). + +%% Supervisor callbacks +-export([init/1]). + +%% Helper macro for declaring children of supervisor +%~ -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). + +%% =================================================================== +%% API functions +%% =================================================================== + +start_link(Configfile) -> + supervisor:start_link(?MODULE, [Configfile]). + +%% =================================================================== +%% Supervisor callbacks +%% =================================================================== + +init(Configfile) -> + SupFlags = #{strategy => one_for_one, intensity => 1, period => 5}, + ChildSpecs = [#{id => ss7MAPer, + start => {ss7MAPer, start_link, Configfile}, + restart => permanent, + shutdown => brutal_kill, + type => worker, + modules => [ss7MAPer]}], + {ok, {SupFlags, ChildSpecs}}. |