initial version
[lwes-erlang.git] / src / lwes_channel_sup.erl
blob461e827d29a758af937c9f0e63478152b7b1c721
1 -module (lwes_channel_sup).
3 -behaviour (supervisor).
5 -ifdef(HAVE_EUNIT).
6 -include_lib("eunit/include/eunit.hrl").
7 -endif.
9 %% API
10 -export ([ start_link/0,
11 open_channel/1 ]).
13 %% supervisor callbacks
14 -export ([ init/1 ]).
16 %%====================================================================
17 %% API functions
18 %%====================================================================
19 %% @spec start_link() -> ServerRet
20 %% @doc API for starting the supervisor.
21 start_link() ->
22 supervisor:start_link({local, ?MODULE}, ?MODULE, []).
24 open_channel (Channel) ->
25 supervisor:start_child (?MODULE, [Channel]).
27 %%====================================================================
28 %% supervisor callbacks
29 %%====================================================================
30 %% @spec init([]) -> SupervisorTree
31 %% @doc supervisor callback.
32 init([]) ->
33 { ok,
35 {simple_one_for_one, 10, 10},
36 [ { lwes_channel,
37 {lwes_channel, start_link, []},
38 transient,
39 2000,
40 worker,
41 [lwes_channel]
47 %%====================================================================
48 %% Test functions
49 %%====================================================================
50 -ifdef(EUNIT).
52 -endif.