[stomp_sup] Add stomp_worker spec
This commit is contained in:
parent
fca24f14f7
commit
0d608be29c
3 changed files with 23 additions and 13 deletions
|
@ -1,12 +0,0 @@
|
|||
-module(stomp.erl_sup).
|
||||
-behaviour(supervisor).
|
||||
|
||||
-export([start_link/0]).
|
||||
-export([init/1]).
|
||||
|
||||
start_link() ->
|
||||
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||
|
||||
init([]) ->
|
||||
Procs = [],
|
||||
{ok, {{one_for_one, 1, 5}, Procs}}.
|
|
@ -1,4 +1,4 @@
|
|||
-module(stomp.erl_app).
|
||||
-module(stomp_app).
|
||||
-behaviour(application).
|
||||
|
||||
-export([start/2]).
|
22
src/stomp_sup.erl
Normal file
22
src/stomp_sup.erl
Normal file
|
@ -0,0 +1,22 @@
|
|||
-module(stomp_sup).
|
||||
-behaviour(supervisor).
|
||||
|
||||
-export([start_link/0]).
|
||||
-export([init/1]).
|
||||
|
||||
start_link() ->
|
||||
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||
|
||||
init([]) ->
|
||||
Procs = [stomp_spec()],
|
||||
{ok, {{one_for_one, 1, 5}, Procs}}.
|
||||
|
||||
%% Private
|
||||
|
||||
stomp_spec() ->
|
||||
#{id => stomp_proc,
|
||||
start => {stomp_worker, start_link, []},
|
||||
restart => permanent,
|
||||
shutdown => 5000,
|
||||
type => worker,
|
||||
module => [stomp_worker]}
|
Loading…
Reference in a new issue