about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <vincent@kivra.com>2016-02-08T23·36+0100
committerVincent Ambo <vincent@kivra.com>2016-02-08T23·36+0100
commit0d608be29cbf75ecfc88a7be962130f3a5a38137 (patch)
tree6c6d788f0f0eef64076afbd8182666cee27bd760
parentfca24f14f72e00f22e10438253784f77a806d813 (diff)
[stomp_sup] Add stomp_worker spec
-rw-r--r--src/stomp.erl_sup.erl12
-rw-r--r--src/stomp_app.erl (renamed from src/stomp.erl_app.erl)2
-rw-r--r--src/stomp_sup.erl22
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]}