summaryrefslogtreecommitdiff
path: root/src/membership_sup.erl
blob: f203924ddbcbe03d4c2d85c8155d13981fa81d63 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
-module(membership_sup).
-author('brad@cloudant.com').

-behaviour(supervisor).

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

%% Supervisor callbacks
-export([init/1]).

-define(SERVER, ?MODULE).

start_link() ->
    supervisor:start_link(?MODULE, []).

init(_Args) ->
    Membership = {membership,
                  {mem3, start_link, []},
                  permanent,
                  1000,
                  worker,
                  [mem3]},
    MemEventMgr = {mem_event_manager,
                   {gen_event, start_link, [{local, membership_events}]},
                   permanent,
                   1000,
                   worker,
                   []},
    DbsRepl =
        {dbs,
         {dbs, start_link, []},
         permanent,
         infinity,
         supervisor,
         [dbs]},
    DbsCache =
        {dbs_cache,
         {dbs_cache, start_link, []},
         permanent,
         1000,
         worker,
         [dbs_cache]},
    {ok, {{one_for_one,10,1}, [Membership, MemEventMgr, DbsRepl, DbsCache]}}.