1. 程式人生 > >Erlang 中application 導出接口

Erlang 中application 導出接口

ini org func () ati opts reason tar load

ensure_all_started(Application) ->    {ok, Started} | {error, Reason} ensure_all_started(Application, Type) -> {ok, Started} | {error, Reason}

Types

  Application = atom()   Type = restart_type()   Started = [atom()]   Reason = term() ensure_started(Application) -> ok | {error, Reason} ensure_started(Application, Type) -. ok | {error, Reason}

Types

  Application = atom()   Type = restart_type()   Reason = term() get_all_env() -> Env get_all_env(Application) -> Env

Types

  Application = atom()

  Env = [{Par :: atom(), Val :: term()}]

get_all_key() -> [] | {ok, Keys} get_all_key(Application) -> undefined | Keys

Types

  Application = atom()
  Keys = {ok, [{Key :: atom(), Val :: term()}, ...]} get_application() -> undefined | {ok, Application} get_application(PidOrModule) -> undefined | {ok, Application}

Types

  PidOrModule = (Pid :: pid()) | (Module :: module())   Application = atom() get_env(Par) -> undefined | {ok, Val} get_env(Application, Par) -> undefined | {ok, Val}

Types

  Application = Par = atom()   Val = term() get_env(Application, Par, Def) -> Val

Types

Application = Par = atom() Def = Val = term() get_key(Key) -> undefined | {ok, Val} get_key(Application, Key) -> undefined | {ok, Val}

Types

Application = Key = atom() Val = term() load(AppDescr) -> ok | {error, Reason} load(AppDescr, Distributed) -> ok | {error, Reason}

Types

AppDescr = Application | (AppSpec :: application_spec()) Application = atom() Distributed =
{Application, Nodes} | {Application, Time, Nodes} | default
Nodes = [node() | tuple_of(node())] Time = integer() >= 1 Reason = term() application_spec() =
{application,
Application :: atom(),
AppSpecKeys :: [application_opt()]}
application_opt() =
{description, Description :: string()} |
{vsn, Vsn :: string()} |
{id, Id :: string()} |
{modules, [Module :: module()]} |
{registered, Names :: [Name :: atom()]} |
{applications, [Application :: atom()]} |
{included_applications, [Application :: atom()]} |
{env, [{Par :: atom(), Val :: term()}]} |
{start_phases,
[{Phase :: atom(), PhaseArgs :: term()}] | undefined} |
{maxT, MaxT :: timeout()} |
{maxP, MaxP :: integer() >= 1 | infinity} |
{mod, Start :: {Module :: module(), StartArgs :: term()}}
loaded_applications() -> [{Application, Description, Vsn}]

Types

Application = atom() Description = Vsn = string() permit(Application, Permission) -> ok | {error, Reason}

Types

Application = atom() Permission = boolean() Reason = term() set_env(Application, Par, Val) -> ok set_env(Application, Par, Val, Opts) -> ok

Types

Application = Par = atom() Val = term() Opts = [{timeout, timeout()} | {persistent, boolean()}] start(Application) -> ok | {error, Reason} start(Application, Type) -> ok | {error, Reason}

Types

Application = atom() Type = restart_type() Reason = term() start_type() -> StartType | undefined | local

Types

StartType = start_type() stop(Application) -> ok | {error, Reason}

Types

Application = atom() Reason = term() takeover(Application, Type) -> ok | {error, Reason}

Types

Application = atom() Type = restart_type() Reason = term() unload(Application) -> ok | {error, Reason}

Types

Application = atom() Reason = term() unset_env(Application, Par) -> ok unset_env(Application, Par, Opts) -> ok

Types

Application = Par = atom() Opts = [{timeout, timeout()} | {persistent, boolean()}] which_applications() -> [{Application, Description, Vsn}] which_applications(Timeout) -> [{Application, Description, Vsn}]

Types

Timeout = timeout() Application = atom() Description = Vsn = string()

Module:start(StartType, StartArgs) -> {ok, Pid} | {ok, Pid, State} | {error, Reason}

Module:start_phase(Phase, StartType, PhaseArgs) -> ok | {error, Reason}

Module:prep_stop(State) -> NewState

Module:stop(State)

Module:config_change(Changed, New, Removed) -> ok

Erlang 中application 導出接口