PageRenderTime 3ms CodeModel.GetById 0ms RepoModel.GetById 1ms 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
Possible License(s): MIT
  1. %% @author Bob Ippolito <bob@mochimedia.com>
  2. %% @copyright 2007 Mochi Media, Inc.
  3. %% @doc Supervisor for the mochiweb application.
  4. -module(mochiweb_sup).
  5. -author('bob@mochimedia.com').
  6. -behaviour(supervisor).
  7. %% External exports
  8. -export([start_link/0, upgrade/0]).
  9. %% supervisor callbacks
  10. -export([init/1]).
  11. %% @spec start_link() -> ServerRet
  12. %% @doc API for starting the supervisor.
  13. start_link() ->
  14. supervisor:start_link({local, ?MODULE}, ?MODULE, []).
  15. %% @spec upgrade() -> ok
  16. %% @doc Add processes if necessary.
  17. upgrade() ->
  18. {ok, {_, Specs}} = init([]),
  19. [supervisor:start_child(?MODULE, Spec) || Spec <- Specs],
  20. ok.
  21. %% @spec init([]) -> SupervisorTree
  22. %% @doc supervisor callback, ensures yaws is in embedded mode and then
  23. %% returns the supervisor tree.
  24. init([]) ->
  25. Processes = [],
  26. {ok, {{one_for_one, 10, 10}, Processes}}.
  27. %%
  28. %% Tests
  29. %%
  30. -include_lib("eunit/include/eunit.hrl").
  31. -ifdef(TEST).
  32. -endif.