Created
October 29, 2016 04:15
-
-
Save elbrujohalcon/03a5c75d9d2f3075cd56cad0b0079a2d 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(animals_sup). | |
-behaviour(supervisor). | |
-export([start_link/1, init/1]). | |
start_link(Name) -> supervisor:start_link({local, Name}, ?MODULE, Name). | |
init(Name) -> | |
SupFlags = #{ strategy => simple_one_for_one | |
, intensity => 5 % restarts in ... | |
, period => 1 % second | |
}, | |
ChildSpecs = [#{ id => animal | |
, start => {animal, start_link, [Name]} | |
, restart => permanent | |
} | |
], | |
{ok, {SupFlags, ChildSpecs}}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment