Sha256: 7a8b6d98fd18b9f5cd582b2764f9a3469a2b1d48d16c1affcd76c99a61bcb868

Contents?: true

Size: 1.03 KB

Versions: 62

Compression:

Stored size: 1.03 KB

Contents

% This supervisor is responsible for monitoring the 
% client service

-module (pm_master_supervisor).
-behaviour(supervisor).

-export([start/0, start_in_shell_for_testing/0, start_link/1, init/1]).

-ifdef(EUNIT).
-include_lib("eunit/include/eunit.hrl").
-endif.

start() ->
	spawn(fun() ->
			supervisor:start_link({local, ?MODULE}, ?MODULE, _Arg = [])
		end).

start_in_shell_for_testing() ->
	{ok, Pid} = supervisor:start_link({local, ?MODULE}, ?MODULE, _Arg = []),
	unlink(Pid).

start_link(Args) ->
	supervisor:start_link({local, ?MODULE}, ?MODULE, Args).	

init([]) ->
	RestartStrategy = one_for_one,
	MaxRestarts = 1000,
	MaxTimeBetRestarts = 3600,
	TimeoutTime = 5000,

	SupFlags = {RestartStrategy, MaxRestarts, MaxTimeBetRestarts},
	
	% Servers
	EventManager = {pm_event_manager,  {pm_event_manager, start_link, []}, permanent, TimeoutTime, worker, dynamic},
	MasterServer = {pm_master1,  {pm_master, start_link, []}, permanent, TimeoutTime, worker, [pm_master]},	
	
	LoadServers = [EventManager,MasterServer],

	{ok, {SupFlags, LoadServers}}.

Version data entries

62 entries across 62 versions & 3 rubygems

Version Path
auser-poolparty-0.2.35 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.36 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.37 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.38 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.39 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.40 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.41 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.42 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.44 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.45 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.46 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.47 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.48 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.49 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.50 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.51 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.52 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.53 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.54 lib/erlang/messenger/src/pm_master_supervisor.erl
auser-poolparty-0.2.55 lib/erlang/messenger/src/pm_master_supervisor.erl