Now we can start the application from the commandline, and still use supervisors.
This commit is contained in:
parent
72e411aee9
commit
af75d731b4
7 changed files with 20 additions and 4 deletions
|
@ -2,12 +2,17 @@
|
|||
-behaviour(supervisor).
|
||||
|
||||
%% API
|
||||
-export([start_link/1]).
|
||||
-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]).
|
||||
|
||||
|
|
Reference in a new issue