From e7d5812d17e1165492ad342c016c80bad24ae9aa Mon Sep 17 00:00:00 2001 From: Daniel <0xc0decafe@users.noreply.github.com> Date: Wed, 5 Oct 2016 12:42:59 +0200 Subject: Structure changed in regard to erlang OTP. Added binary release. --- src/ss7MAPer_sup.erl | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/ss7MAPer_sup.erl (limited to 'src/ss7MAPer_sup.erl') 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 '). + +-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}}. -- cgit v1.2.3