about summary refs log tree commit diff
path: root/src/hello_sup.erl
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2016-09-22T13·37+0200
committerVincent Ambo <tazjin@gmail.com>2016-09-22T13·37+0200
commitfac2474ac66cd9a561844b1a6a8f9a91aa45e160 (patch)
tree76d8312e6e3e4945ab5f58b8ecb398ce4ebd071d /src/hello_sup.erl
parent6c456a06c7166b70a2347283a7afcfc4107cb3c7 (diff)
Add the rest of the damn presentation
Diffstat (limited to 'src/hello_sup.erl')
-rw-r--r--src/hello_sup.erl24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/hello_sup.erl b/src/hello_sup.erl
new file mode 100644
index 0000000000..7fee0928c5
--- /dev/null
+++ b/src/hello_sup.erl
@@ -0,0 +1,24 @@
+-module(hello_sup).
+-behaviour(supervisor).
+-export([start_link/0, init/1]).
+
+%%% Module API
+
+start_link() ->
+    supervisor:start_link({local, ?MODULE}, ?MODULE, []).
+
+%%% Supervisor callbacks
+
+init([]) ->
+    Children = [hello_spec()],
+    {ok, { {one_for_one, 5, 10}, Children}}.
+
+%%% Private
+
+hello_spec() ->
+    #{id       => hello_server2,
+      start    => {hello_server2, start_link, []},
+      restart  => permanent,
+      shutdown => 5000,
+      type     => worker,
+      module   => [hello_server2]}.