Last active
September 26, 2017 02:28
-
-
Save elbrujohalcon/f9753387a98a798ea829a0bd262522ec to your computer and use it in GitHub Desktop.
Maybe Supervisor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(maybe_sup). | |
-behaviour(supervisor). | |
-export([start/0, stop/0]). | |
-export([init/1]). | |
%% EXTERNAL API ------------------------------------------------------------------------------------ | |
start() -> supervisor:start_link({local, ?MODULE}, ?MODULE, #{}). | |
stop() -> | |
gen_server:stop(?MODULE). | |
%% CALLBACKS --------------------------------------------------------------------------------------- | |
init(#{}) -> | |
SupFlags = #{strategy => one_for_one}, | |
ChildSpecs = [#{ id => maybe_server | |
, start => {maybe_server, start_link, []} | |
}], | |
{ok, {SupFlags, ChildSpecs}}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment