Sha256: 66bcc658cdeb181914709f1a2f89d9fb388317f7b8a0662ab57d4cbd20082703

Contents?: true

Size: 759 Bytes

Versions: 14

Compression:

Stored size: 759 Bytes

Contents

%%
%% Application module
%%
%% File   : capricorn_app.erl
%% Created: 2010-01-04
%%
%% @author simonmenke <simon.menke@gmail.com>
%% @copyright 2010 simonmenke
%%
%% @doc TODO make nice description
%%

-module(capricorn_app).
-author('simonmenke <simon.menke@gmail.com>').
-include("capricorn.hrl").

-behaviour(application).
 
-export([start/2, stop/1]).

-spec start(_,_) -> {'error','already_started'} | {'ok',pid()} .
start(_Type, _) ->
  NodeType = get_ini_node_type(),
  cap_sup:start_link(NodeType).

stop(_) ->
  cap_sup:stop(),
  ok.

-spec get_ini_node_type() -> machine | cluster .
get_ini_node_type() ->
  case init:get_argument(node_type) of
  error          -> machine;
  {ok, [[]]}     -> machine;
  {ok, [[Type]]} -> list_to_atom(Type)
  end.

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
capricorn-2.0.11 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.10 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.9 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.8 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.7 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.6 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.5 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.4 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.3 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.3.pre2 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.3.pre erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.2 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.1 erlang/lib/capricorn/src/capricorn_app.erl
capricorn-2.0.0 erlang/lib/capricorn/src/capricorn_app.erl