1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
%%% Copyright (c) 2014, NORDUnet A/S.
%%% See LICENSE for licensing information.
-module(plop_sup).
-behaviour(supervisor).
-export([start_link/1, init/1]).
-export([start_in_shell/1]).
start_link(Args) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, Args).
%% For testing.
start_in_shell(Args) ->
{ok, Pid} = start_link(Args),
unlink(Pid).
%% Supervisor callback
init(Args) ->
{ok, {{one_for_one, 3, 10},
[{the_db,
{db, start_link, []},
permanent,
10000,
worker, [db]},
{fsync,
{fsyncport, start_link, []},
permanent,
10000,
worker, [fsyncport]},
{the_ht,
{ht, start_link, []},
permanent,
10000,
worker, [ht]},
{the_plop,
{plop, start_link, Args}, % All arguments go to plop.
permanent,
10000, % Shut down within 10s.
worker, [plop]}]}}.
|