diff options
author | Daniel <0xc0decafe@users.noreply.github.com> | 2016-10-05 12:42:59 +0200 |
---|---|---|
committer | Daniel <0xc0decafe@users.noreply.github.com> | 2016-10-05 12:42:59 +0200 |
commit | e7d5812d17e1165492ad342c016c80bad24ae9aa (patch) | |
tree | 3c67a47eb255f04f831f535848658f20d9493480 /src/ss7MAPer_sup.erl | |
parent | b99ffff4982e19424fc78abadd57100a8032bdad (diff) |
Structure changed in regard to erlang OTP. Added binary release.
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}}. |