diff options
author | Vincent Ambo <vincent@kivra.com> | 2016-02-08T23·36+0100 |
---|---|---|
committer | Vincent Ambo <vincent@kivra.com> | 2016-02-08T23·36+0100 |
commit | 0d608be29cbf75ecfc88a7be962130f3a5a38137 (patch) | |
tree | 6c6d788f0f0eef64076afbd8182666cee27bd760 | |
parent | fca24f14f72e00f22e10438253784f77a806d813 (diff) |
[stomp_sup] Add stomp_worker spec
-rw-r--r-- | src/stomp.erl_sup.erl | 12 | ||||
-rw-r--r-- | src/stomp_app.erl (renamed from src/stomp.erl_app.erl) | 2 | ||||
-rw-r--r-- | src/stomp_sup.erl | 22 |
3 files changed, 23 insertions, 13 deletions
diff --git a/src/stomp.erl_sup.erl b/src/stomp.erl_sup.erl deleted file mode 100644 index 9c41cba1f202..000000000000 --- a/src/stomp.erl_sup.erl +++ /dev/null @@ -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}}. diff --git a/src/stomp.erl_app.erl b/src/stomp_app.erl index 78a6ecc92f2c..b7d889c3f485 100644 --- a/src/stomp.erl_app.erl +++ b/src/stomp_app.erl @@ -1,4 +1,4 @@ --module(stomp.erl_app). +-module(stomp_app). -behaviour(application). -export([start/2]). diff --git a/src/stomp_sup.erl b/src/stomp_sup.erl new file mode 100644 index 000000000000..96d4aafb9fba --- /dev/null +++ b/src/stomp_sup.erl @@ -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]} |