Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added one_for_one supervisor

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1341 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
commit b4239b9acf9c975d15634121676018d820cc26aa 1 parent a0d2c83
@klacke authored
Showing with 54 additions and 0 deletions.
  1. +54 −0 src/yaws_sup_restarts.erl
View
54 src/yaws_sup_restarts.erl
@@ -0,0 +1,54 @@
+%%% File : yaws_sup_restarts.erl
+%%% Author : Claes Wikstrom <klacke@hyber.org>
+%%% Description : Procs that can be restarted
+%%% Created : 13 Jan 2009 by Claes Wikstrom <klacke@hyber.org>
+
+-module(yaws_sup_restarts).
+
+-behaviour(supervisor).
+
+%% External exports
+-export([start_link/0]).
+
+%% supervisor callbacks
+-export([init/1]).
+
+
+%%%----------------------------------------------------------------------
+%%% API
+%%%----------------------------------------------------------------------
+start_link() ->
+ supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+
+%%%----------------------------------------------------------------------
+%%% Callback functions from supervisor
+%%%----------------------------------------------------------------------
+
+%%----------------------------------------------------------------------
+%%----------------------------------------------------------------------
+init([]) ->
+ Sess = {yaws_session_server, {yaws_session_server, start_link, []},
+ permanent, 5000, worker, [yaws_session_server]},
+ YawsRSS = {yaws_rss,
+ {yaws_rss, start_link, []},
+ permanent, 5000, worker, [yaws_rss]},
+
+
+ YawsEventManager = {yaws_event_manager,
+ {gen_event, start_link,[{local,yaws_event_manager}]},
+ permanent, 5000, worker, [gen_event]},
+
+
+ SendFile = case yaws_sendfile_compat:enabled() of
+ true ->
+ [{yaws_sendfile,
+ {yaws_sendfile_compat, start_link, []},
+ permanent, 5000, worker, [yaws_sendfile]}];
+ false ->
+ []
+ end,
+
+
+ {ok,{{one_for_one, 1, 60}, [Sess, YawsRSS, YawsEventManager] ++ SendFile}}.
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.