update ChangeLog
[lwes-erlang/github-mirror.git] / src / lwes_channel_sup.erl
blob8589ae4ed985232344d284abe8183e48289d633c
1 -module (lwes_channel_sup).
3 -behaviour (supervisor).
5 %% API
6 -export ([ start_link/0,
7 open_channel/1 ]).
9 %% supervisor callbacks
10 -export ([ init/1 ]).
12 %%====================================================================
13 %% API functions
14 %%====================================================================
15 %% @spec start_link() -> ServerRet
16 %% @doc API for starting the supervisor.
17 start_link() ->
18 supervisor:start_link({local, ?MODULE}, ?MODULE, []).
20 open_channel (Channel) ->
21 supervisor:start_child (?MODULE, [Channel]).
23 %%====================================================================
24 %% supervisor callbacks
25 %%====================================================================
26 %% @spec init([]) -> SupervisorTree
27 %% @doc supervisor callback.
28 init([]) ->
29 { ok,
31 {simple_one_for_one, 10, 10},
32 [ { lwes_channel,
33 {lwes_channel, start_link, []},
34 transient,
35 2000,
36 worker,
37 [lwes_channel]
43 %%====================================================================
44 %% Test functions
45 %%====================================================================
46 -ifdef (TEST).
47 -include_lib ("eunit/include/eunit.hrl").
49 -endif.