Sha256: 441f1fa6632c9e19cf2554bb153ad4d1993a734245f2e88421cff35307cfe534

Contents?: true

Size: 603 Bytes

Versions: 16

Compression:

Stored size: 603 Bytes

Contents

-module(ernie_server_sup).
-behaviour(supervisor).
-export([start_link/0, init/1]).

start_link() ->
  supervisor:start_link({local, ?MODULE}, ?MODULE, []).

init([]) ->
  {ok, Port} = application:get_env(ernie_server_app, port),
  io:format("Using port ~p~n", [Port]),
  case application:get_env(ernie_server_app, pidfile) of
    {ok, Location} ->
      Pid = os:getpid(),
      ok = file:write_file(Location, list_to_binary(Pid));
    undefined -> ok
  end,
  {ok, {{one_for_one, 1, 60},
    [{ernie_server, {ernie_server, start_link, [[Port]]},
    permanent, brutal_kill, worker, [ernie_server]}]}}.

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
mojombo-ernie-0.2.0 elib/ernie_server_sup.erl
mojombo-ernie-0.3.0 elib/ernie_server_sup.erl
mojombo-ernie-0.3.1 elib/ernie_server_sup.erl
mojombo-ernie-0.3.2 elib/ernie_server_sup.erl
mojombo-ernie-0.3.3 elib/ernie_server_sup.erl
mojombo-ernie-0.3.4 elib/ernie_server_sup.erl
ernie-1.3.0 elib/ernie_server_sup.erl
ernie-1.2.0 elib/ernie_server_sup.erl
ernie-1.1.0 elib/ernie_server_sup.erl
ernie-1.0.0 elib/ernie_server_sup.erl
ernie-0.4.0 elib/ernie_server_sup.erl
ernie-0.3.5 elib/ernie_server_sup.erl
ernie-0.3.4 elib/ernie_server_sup.erl
ernie-0.3.3 elib/ernie_server_sup.erl
ernie-0.3.2 elib/ernie_server_sup.erl
ernie-0.3.1 elib/ernie_server_sup.erl