Last active
October 29, 2016 05:01
-
-
Save elbrujohalcon/3774b4b82edd7c785914d9cecb71a379 to your computer and use it in GitHub Desktop.
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(world_sup). | |
-behaviour(supervisor). | |
-export([start_link/0, init/1]). | |
start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, noargs). | |
init(noargs) -> | |
SupFlags = #{ strategy => one_for_one | |
, intensity => 100 % restarts in ... | |
, period => 1 % second | |
}, | |
ChildSpecs = [#{ id => dodos_sup | |
, start => {animals_sup, start_link, [dodos]} | |
, restart => transient | |
, type => supervisor | |
} | |
, #{ id => cockroaches_sup | |
, start => {animals_sup, start_link, [cockroaches]} | |
, restart => permanent | |
, type => supervisor | |
} | |
], | |
{ok, {SupFlags, ChildSpecs}}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment