summaryrefslogtreecommitdiff
path: root/merge/src/merge_fetch_sup.erl
blob: 6dd1735d863899eb620cbbb03688ee1ef0d26b9d (plain)
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
%%% Copyright (c) 2017, NORDUnet A/S.
%%% See LICENSE for licensing information.

-module(merge_fetch_sup).
-behaviour(supervisor).

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

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

init(StorageNodes) ->
    lager:debug("starting with storage nodes: ~p", [StorageNodes]),
    {ok,
     {{one_for_all, 3, 10},
      [
       {merge_fetch_newentries_sup,
        {merge_fetch_newentries_sup, start_link, [StorageNodes]},
        transient, infinity, supervisor,
        [merge_fetch_newentries_sup]},
       {merge_fetch_ctrl,
        {merge_fetch_ctrl, start_link, [StorageNodes]},
        permanent, 10000, worker,
        [merge_fetch_ctrl]},
       {merge_fetch_fetch_sup,
        {merge_fetch_fetch_sup, start_link, [StorageNodes]},
        transient, infinity, supervisor,
        [merge_fetch_fetch_sup]}
      ]}}.