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.
42