码迷,mamicode.com
首页 > 移动开发 > 详细

Erlang 中application 导出接口

时间:2018-02-25 13:14:19      阅读:473      评论:0      收藏:0      [点我收藏+]

标签:val   unset   ror   integer   ensure   erlang   mis   move   clu   

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()
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()
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 导出接口

标签:val   unset   ror   integer   ensure   erlang   mis   move   clu   

原文地址:https://www.cnblogs.com/tianxincode/p/8468796.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!