Skip to content

Instantly share code, notes, and snippets.

@zxq9
Forked from orzen/ertorrent_torrent_ssup.erl
Last active April 29, 2016 02:45
Show Gist options
  • Save zxq9/93498baf7767aac1a825c249a4c1fe81 to your computer and use it in GitHub Desktop.
Save zxq9/93498baf7767aac1a825c249a4c1fe81 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) ->
RestartStrategy = {one_for_one, 4, 5},
ServiceSup = #{id => ertorrent_torrent_sup,
start => {ertorrent_torrent_sup, start_link, []},
shutdown => brutal_kill,
type => supervisor},
Server = #{id => ertorrent_torrent_srv,
start => {ertorrent_torrent_srv, start_link, []},
shutdown => brutal_kill,
type => worker},
Children = [ServiceSup, Server],
{ok, {RestartStrategy, Children}}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment