Skip to content

Instantly share code, notes, and snippets.

@onlyshk
Created January 30, 2011 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onlyshk/802847 to your computer and use it in GitHub Desktop.
Save onlyshk/802847 to your computer and use it in GitHub Desktop.
sup1
-module(popd_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
-export([stop/0]).
%% Supervisor callbacks
-export([init/1]).
-define(SERVER, ?MODULE).
%%% API functions
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
RestartStrategy = {one_for_one, 5, 600},
ListenerSup = {popd_listener_sup,
{popd_listener_sup, start_link, []},
permanent, 2000, supervisor, [popd_listener_sup]},
Children = [ListenerSup],
{ok, {RestartStrategy, Children}}.
stop() ->
exit(whereis(?MODULE), shutdown).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment