about summary refs log tree commit diff
path: root/net/stomp_erl/src/stomp_sup.erl
blob: 3a298bc9bf8b16d7fbfc4c7a25a6ac8bd967e858 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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]}.