Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 55 lines (38 sloc) 1.76 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
6a4c4e7 @vinoski change sendfile driver handler to a gen_server
vinoski authored
42 SendFile = case yaws_sendfile:enabled() of
b4239b9 @klacke added one_for_one supervisor
authored
43 true ->
6a4c4e7 @vinoski change sendfile driver handler to a gen_server
vinoski authored
44 [{yaws_sendfile,
45 {yaws_sendfile, start_link, []},
b4239b9 @klacke added one_for_one supervisor
authored
46 permanent, 5000, worker, [yaws_sendfile]}];
47 false ->
48 []
49 end,
50
51
52 {ok,{{one_for_one, 1, 60}, [Sess, YawsRSS, YawsEventManager] ++ SendFile}}.
53
54
Something went wrong with that request. Please try again.