PageRenderTime 101ms CodeModel.GetById 60ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 0ms

/src/mochiweb_sup.erl

http://github.com/basho/mochiweb
Erlang | 41 lines | 17 code | 9 blank | 15 comment | 1 complexity | 2f98ce725a6c17ac72d9dd192fc78c76 MD5 | raw file
 1%% @author Bob Ippolito <bob@mochimedia.com>
 2%% @copyright 2007 Mochi Media, Inc.
 3
 4%% @doc Supervisor for the mochiweb application.
 5
 6-module(mochiweb_sup).
 7-author('bob@mochimedia.com').
 8
 9-behaviour(supervisor).
10
11%% External exports
12-export([start_link/0, upgrade/0]).
13
14%% supervisor callbacks
15-export([init/1]).
16
17%% @spec start_link() -> ServerRet
18%% @doc API for starting the supervisor.
19start_link() ->
20    supervisor:start_link({local, ?MODULE}, ?MODULE, []).
21
22%% @spec upgrade() -> ok
23%% @doc Add processes if necessary.
24upgrade() ->
25    {ok, {_, Specs}} = init([]),
26    [supervisor:start_child(?MODULE, Spec) || Spec <- Specs],
27    ok.
28
29%% @spec init([]) -> SupervisorTree
30%% @doc supervisor callback, ensures yaws is in embedded mode and then
31%%      returns the supervisor tree.
32init([]) ->
33    Processes = [],
34    {ok, {{one_for_one, 10, 10}, Processes}}.
35
36%%
37%% Tests
38%%
39-include_lib("eunit/include/eunit.hrl").
40-ifdef(TEST).
41-endif.