Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 57 lines (40 sloc) 1.86 kb
b4239b9 @klacke added one_for_one supervisor
authored
1 %%% File : yaws_sup_restarts.erl
2 %%% Author : Claes Wikstrom <klacke@hyber.org>
3 %%% Description : Procs that can be restarted
4 %%% Created : 13 Jan 2009 by Claes Wikstrom <klacke@hyber.org>
5
6 -module(yaws_sup_restarts).
7
8 -behaviour(supervisor).
9
10 %% External exports
11 -export([start_link/0]).
12
13 %% supervisor callbacks
14 -export([init/1]).
15
16
17 %%%----------------------------------------------------------------------
18 %%% API
19 %%%----------------------------------------------------------------------
20 start_link() ->
21 supervisor:start_link({local, ?MODULE}, ?MODULE, []).
22
23 %%%----------------------------------------------------------------------
24 %%% Callback functions from supervisor
25 %%%----------------------------------------------------------------------
26
27 %%----------------------------------------------------------------------
28 %%----------------------------------------------------------------------
29 init([]) ->
30 Sess = {yaws_session_server, {yaws_session_server, start_link, []},
31 permanent, 5000, worker, [yaws_session_server]},
455578a @vinoski major trailing whitespace cleanup
vinoski authored
32 YawsRSS = {yaws_rss,
b4239b9 @klacke added one_for_one supervisor
authored
33 {yaws_rss, start_link, []},
34 permanent, 5000, worker, [yaws_rss]},
6e96a14 @klacke indendation cleanup
authored
35
b4239b9 @klacke added one_for_one supervisor
authored
36
455578a @vinoski major trailing whitespace cleanup
vinoski authored
37 YawsEventManager = {yaws_event_manager,
b4239b9 @klacke added one_for_one supervisor
authored
38 {gen_event, start_link,[{local,yaws_event_manager}]},
39 permanent, 5000, worker, [gen_event]},
40
41
f3622d2 @vinoski dialyzer fixes and comments
vinoski authored
42 %% below, ignore dialyzer warning:
43 %% "The pattern 'false' can never match the type 'true'"
6a4c4e7 @vinoski change sendfile driver handler to a gen_server
vinoski authored
44 SendFile = case yaws_sendfile:enabled() of
b4239b9 @klacke added one_for_one supervisor
authored
45 true ->
6a4c4e7 @vinoski change sendfile driver handler to a gen_server
vinoski authored
46 [{yaws_sendfile,
47 {yaws_sendfile, start_link, []},
b4239b9 @klacke added one_for_one supervisor
authored
48 permanent, 5000, worker, [yaws_sendfile]}];
49 false ->
50 []
51 end,
52
53
54 {ok,{{one_for_one, 1, 60}, [Sess, YawsRSS, YawsEventManager] ++ SendFile}}.
55
56
Something went wrong with that request. Please try again.