Started new structure

This commit is contained in:
Jonatan Pålsson 2011-02-16 15:08:37 +01:00
parent a2854ef469
commit 76148b39d0
14 changed files with 0 additions and 0 deletions

View file

@ -1,34 +0,0 @@
-module(ggs_sup).
-behaviour(supervisor).
%% API
-export([start/1, start_link/1]).
%% Supervisor callbacks
-export([init/1]).
-define(SERVER, ?MODULE).
start(Port) ->
[FirstArg] = Port,
{IntPort, _} = string:to_integer(FirstArg),
start_link(IntPort).
start_link(Port) ->
supervisor:start_link({local, ?SERVER}, ?MODULE, [Port]).
init([Port]) ->
Server = {ggs_server_sup,
{ggs_server_sup, start_link, [Port]},
permanent,
2000,
worker,
[ggs_server_sup]
},
Children = [Server],
RestartStrategy = { one_for_one, % Restart only crashing child
10, % Allow ten crashes per..
1 % 1 second, then crash supervisor.
},
{ok, {RestartStrategy, Children}}.