[stomp_sup] Add stomp_worker spec

This commit is contained in:
Vincent Ambo 2016-02-09 00:36:54 +01:00
parent fca24f14f7
commit 0d608be29c
No known key found for this signature in database
GPG key ID: 66F505681DB8F43B
3 changed files with 23 additions and 13 deletions

View file

@ -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}}.

View file

@ -1,4 +1,4 @@
-module(stomp.erl_app).
-module(stomp_app).
-behaviour(application).
-export([start/2]).

22
src/stomp_sup.erl Normal file
View 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]}