GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: A new revision of Fuzed, the Erlang-based frontend for web apps. Check out the mailing list at http://groups.google.com/group/fuzed
Clone URL: git://github.com/KirinDave/fuzed.git
mojombo (author)
Sun May 04 20:33:26 -0700 2008
commit  84159d727f2ae308bcb1518c66420e17e790bec7
tree    9f0a478b8f0ce7e87d821d0bd2c6c76ab993ebf1
parent  aac45964081d8d0ec8a423f1f536c722284ca91f
fuzed / elibs / fuzed_supervisor.erl
100644 43 lines (36 sloc) 1.37 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
%%%-------------------------------------------------------------------
%%% Author : Tom Preston-Werner
%%%-------------------------------------------------------------------
-module(fuzed_supervisor).
-behaviour(supervisor).
 
-export([start/0, start_shell/0, start_link/1, init/1]).
 
start() ->
  application:set_env(fuzed, in_rotation, true),
  spawn(fun() ->
    supervisor:start_link({local, ?MODULE}, ?MODULE, _Arg = [])
  end).
  
start_shell() ->
  {ok, Pid} = supervisor:start_link({local, ?MODULE}, ?MODULE, _Arg = []),
  unlink(Pid).
  
start_link(Args) ->
  application:set_env(fuzed, in_rotation, true),
  supervisor:start_link({local, ?MODULE}, ?MODULE, Args).
  
init([]) ->
  % start the YAWS api server.
  json_server:test(),
  %erl_boot_server:add_subnet({0, 0, 0, 0}, {0, 0, 0, 0}),
  
  % return the supervisor spec for the resource fountain
  {ok, {{one_for_one, 100, 300},
    [{resource_fountain,
       {resource_fountain, start_link, []},
       permanent, 10000, worker, [resource_fountain]},
     {pool_sweeper,
       {pool_sweeper, start_link, []},
       permanent, 10000, worker, [pool_sweeper]},
     {fuzed_code_monitor,
       {fuzed_code_monitor, start_link, []},
       permanent, 10000, worker, [fuzed_code_monitor]},
     {logger,
       {logger, start_link, ["/var/log/fuzed"]},
       permanent, 10000, worker, [logger]}
    ]}}.