initial version
[lwes-erlang.git] / src / lwes_sup.erl
blobe5b54fa8ffff4a254d841f074fe61643fe606a78
1 -module (lwes_sup).
3 -behaviour (supervisor).
5 -ifdef(HAVE_EUNIT).
6 -include_lib("eunit/include/eunit.hrl").
7 -endif.
9 %% API
10 -export([start_link/0]).
12 %% supervisor callbacks
13 -export([init/1]).
15 %%====================================================================
16 %% API functions
17 %%====================================================================
18 %% @spec start_link() -> ServerRet
19 %% @doc API for starting the supervisor.
20 start_link() ->
21 supervisor:start_link({local, ?MODULE}, ?MODULE, []).
23 %%====================================================================
24 %% supervisor callbacks
25 %%====================================================================
26 %% @spec init([]) -> SupervisorTree
27 %% @doc supervisor callback.
28 init([]) ->
29 { ok,
31 { one_for_one, 10, 10 },
33 { lwes_channel_manager, % child spec id
34 { lwes_channel_manager, start_link, [] },% child function to call
35 permanent, % always restart
36 2000, % time to wait for child stop
37 worker, % type of child
38 [ lwes_channel_manager ] % modules used by child
41 lwes_channel_sup, % child spec id
42 { lwes_channel_sup, start_link, []}, % child function to call
43 permanent, % always restart
44 2000, % time to wait for child stop
45 supervisor, % type of child
46 [lwes_channel_sup] % modules used by child
52 %%====================================================================
53 %% Test functions
54 %%====================================================================
55 -ifdef(EUNIT).
57 -endif.