Source

brocessing / src / brocessing_sup.erl

%% Copyright © 2013 Pierre Fenoll
%% See LICENSE for licensing information.
%% -*- coding: utf-8 -*-
-module(brocessing_sup).
-behaviour(supervisor).

-include("include/defaults.hrl").

%% API
-export([start_link/0]).

%% 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() ->
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).

%% ===================================================================
%% Supervisor callbacks
%% ===================================================================

init([]) ->
	RestartStrategy = one_for_one,
	MaxRestarts = 1000,
	MaxSecondsBetweenRestarts = 3600,

	RunPolicy = permanent,
	TimeItHasToShutdown = 2000,
	Type = worker,
	ModulesItUses = [stateful, tools_sf, stateless],

	AChild = {?SERVER, {stateful,start_link,[]},
		RunPolicy, TimeItHasToShutdown, Type, ModulesItUses},

	{ok, {{RestartStrategy, MaxRestarts, MaxSecondsBetweenRestarts},
		 [AChild]
	}}.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.