Skip to content

Instantly share code, notes, and snippets.

@orzen
Created April 28, 2016 16:57
Show Gist options
  • Save orzen/d62f6b575ad27eb8c7bac1b22c02c78e to your computer and use it in GitHub Desktop.
Save orzen/d62f6b575ad27eb8c7bac1b22c02c78e to your computer and use it in GitHub Desktop.
-module(ertorrent_torrent_ssup).
-behaviour(supervisor).
-export([start_link/0,
init/1]).
start_link() ->
supervisor:start_link(ertorrent_torrent_ssup, []).
init(_Arg) ->
MaxRestart = 4,
MaxTime = 5,
SupFlags = {one_for_one, MaxRestart, MaxTime},
SupSpecs = [#{id => ertorrent_torrent_sup,
start => {ertorrent_torrent_sup, start_link, []},
shutdown => brutal_kill,
type => supervisor}],
SrvSpecs = [#{id => ertorrent_torrent_srv,
start => {ertorrent_torrent_srv, start_link, []},
shutdown => brutal_kill,
type => worker}],
{ok, {SupFlags,[SupSpecs, SrvSpecs]}}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment