various fixes, see ChangeLog
[lwes-erlang/github-mirror.git] / src / lwes_sup.erl
blobca0884499bc535a9ec255683eaab50f2046d6910
1 -module (lwes_sup).
3 -behaviour (supervisor).
5 %% API
6 -export([start_link/0]).
8 %% supervisor callbacks
9 -export([init/1]).
11 %-=====================================================================-
12 %- API -
13 %-=====================================================================-
14 start_link() ->
15 supervisor:start_link({local, ?MODULE}, ?MODULE, []).
17 %-=====================================================================-
18 %- supervisor callbacks -
19 %-=====================================================================-
20 init([]) ->
21 { ok,
23 { one_for_one, 10, 10 },
25 { lwes_channel_manager, % child spec id
26 { lwes_channel_manager, start_link, [] },% child function to call
27 permanent, % always restart
28 2000, % time to wait for child stop
29 worker, % type of child
30 [ lwes_channel_manager ] % modules used by child
33 lwes_channel_sup, % child spec id
34 { lwes_channel_sup, start_link, []}, % child function to call
35 permanent, % always restart
36 2000, % time to wait for child stop
37 supervisor, % type of child
38 [ lwes_channel_sup ] % modules used by child
40 { lwes_esf_validator, % child spec id
41 { lwes_esf_validator, start_link, [] }, % child function to call
42 permanent, % always restart
43 2000, % time to wait for child stop
44 worker, % type of child
45 [ lwes_esf_validator ] % modules used by child
51 %-=====================================================================-
52 %- Private -
53 %-=====================================================================-
56 %-=====================================================================-
57 %- Test Functions -
58 %-=====================================================================-
59 -ifdef (TEST).
60 -include_lib ("eunit/include/eunit.hrl").
62 lwes_sup_test_ () ->
63 { setup,
64 fun () ->
65 {ok, Pid} = start_link(),
66 Pid
67 end,
68 fun (Pid) ->
69 exit (Pid, normal)
70 end,
72 inorder,
74 ?_assertEqual (true, true)
79 -endif.