|
|
@ -52,44 +52,44 @@ |
|
|
|
end). |
|
|
|
|
|
|
|
-type serverName() :: |
|
|
|
{'local', atom()} | |
|
|
|
{'global', GlobalName :: term()} | |
|
|
|
{'via', RegMod :: module(), Name :: term()}. |
|
|
|
{'local', atom()} | |
|
|
|
{'global', GlobalName :: term()} | |
|
|
|
{'via', RegMod :: module(), Name :: term()}. |
|
|
|
|
|
|
|
-type serverRef() :: |
|
|
|
pid() |
|
|
|
| (LocalName :: atom()) |
|
|
|
| {Name :: atom(), Node :: atom()} |
|
|
|
| {'global', GlobalName :: term()} |
|
|
|
| {'via', RegMod :: module(), ViaName :: term()}. |
|
|
|
pid() |
|
|
|
| (LocalName :: atom()) |
|
|
|
| {Name :: atom(), Node :: atom()} |
|
|
|
| {'global', GlobalName :: term()} |
|
|
|
| {'via', RegMod :: module(), ViaName :: term()}. |
|
|
|
|
|
|
|
-type startOpt() :: |
|
|
|
{'timeout', Time :: timeout()} | |
|
|
|
{'spawn_opt', [proc_lib:spawn_option()]} | |
|
|
|
enterLoopOpt(). |
|
|
|
{'timeout', Time :: timeout()} | |
|
|
|
{'spawn_opt', [proc_lib:spawn_option()]} | |
|
|
|
enterLoopOpt(). |
|
|
|
|
|
|
|
-type enterLoopOpt() :: |
|
|
|
{'debug', Debugs :: [sys:debug_option()]} | |
|
|
|
{'hibernate_after', HibernateAfterTimeout :: timeout()}. |
|
|
|
{'debug', Debugs :: [sys:debug_option()]} | |
|
|
|
{'hibernate_after', HibernateAfterTimeout :: timeout()}. |
|
|
|
|
|
|
|
-type startRet() :: |
|
|
|
'ignore' | |
|
|
|
{'ok', pid()} | |
|
|
|
{'ok', {pid(), reference()}} | |
|
|
|
{'error', term()}. |
|
|
|
'ignore' | |
|
|
|
{'ok', pid()} | |
|
|
|
{'ok', {pid(), reference()}} | |
|
|
|
{'error', term()}. |
|
|
|
|
|
|
|
-type action() :: |
|
|
|
timeout() | |
|
|
|
hibernate | |
|
|
|
{'doAfter', Args :: term()} | |
|
|
|
{'nTimeout', Name :: term(), Time :: timeouts(), TimeoutMsg :: term()} | |
|
|
|
{'nTimeout', Name :: term(), Time :: timeouts(), TimeoutMsg :: term(), Options :: ([timeoutOption()])} | |
|
|
|
{'uTimeout', Name :: term(), TimeoutMsg :: term()} | |
|
|
|
{'cTimeout', Name :: term()}. |
|
|
|
timeout() | |
|
|
|
hibernate | |
|
|
|
{'doAfter', Args :: term()} | |
|
|
|
{'nTimeout', Name :: term(), Time :: timeouts(), TimeoutMsg :: term()} | |
|
|
|
{'nTimeout', Name :: term(), Time :: timeouts(), TimeoutMsg :: term(), Options :: ([timeoutOption()])} | |
|
|
|
{'uTimeout', Name :: term(), TimeoutMsg :: term()} | |
|
|
|
{'cTimeout', Name :: term()}. |
|
|
|
|
|
|
|
-type actions() :: |
|
|
|
action() | |
|
|
|
[action(), ...]. |
|
|
|
action() | |
|
|
|
[action(), ...]. |
|
|
|
|
|
|
|
-type timeouts() :: Time :: timeout() | integer(). |
|
|
|
-type timeoutOption() :: {abs, Abs :: boolean()}. |
|
|
@ -111,22 +111,22 @@ action() | |
|
|
|
%% call 消息的返回 |
|
|
|
-export_type([handleCallRet/0]). |
|
|
|
-type handleCallRet() :: |
|
|
|
kpS | |
|
|
|
{reply, Reply :: term()} | |
|
|
|
{reply, Reply :: term(), NewState :: term()} | |
|
|
|
{reply, Reply :: term(), NewState :: term(), Actions :: actions()} | |
|
|
|
{noreply, NewState :: term()} | |
|
|
|
{noreply, NewState :: term(), Actions :: actions()} | |
|
|
|
{stop, Reason :: term(), NewState :: term()} | |
|
|
|
{stopReply, Reason :: term(), Reply :: term(), NewState :: term()}. |
|
|
|
kpS | |
|
|
|
{reply, Reply :: term()} | |
|
|
|
{reply, Reply :: term(), NewState :: term()} | |
|
|
|
{reply, Reply :: term(), NewState :: term(), Actions :: actions()} | |
|
|
|
{noreply, NewState :: term()} | |
|
|
|
{noreply, NewState :: term(), Actions :: actions()} | |
|
|
|
{stop, Reason :: term(), NewState :: term()} | |
|
|
|
{stopReply, Reason :: term(), Reply :: term(), NewState :: term()}. |
|
|
|
|
|
|
|
%% cast 消息的返回 |
|
|
|
-export_type([handleCastRet/0]). |
|
|
|
-type handleCastRet() :: |
|
|
|
kpS | |
|
|
|
{noreply, NewState :: term()} | |
|
|
|
{noreply, NewState :: term(), Actions :: actions()} | |
|
|
|
{stop, Reason :: term(), NewState :: term()}. |
|
|
|
kpS | |
|
|
|
{noreply, NewState :: term()} | |
|
|
|
{noreply, NewState :: term(), Actions :: actions()} | |
|
|
|
{stop, Reason :: term(), NewState :: term()}. |
|
|
|
|
|
|
|
-callback handleInfo(Info :: timeout | term(), State :: term()) -> |
|
|
|
kpS | |
|
|
@ -154,11 +154,11 @@ kpS | |
|
|
|
Status :: term(). |
|
|
|
|
|
|
|
-optional_callbacks([ |
|
|
|
handleAfter/2 |
|
|
|
, handleInfo/2 |
|
|
|
, terminate/2 |
|
|
|
, code_change/3 |
|
|
|
, formatStatus/2 |
|
|
|
handleAfter/2 |
|
|
|
, handleInfo/2 |
|
|
|
, terminate/2 |
|
|
|
, code_change/3 |
|
|
|
, formatStatus/2 |
|
|
|
]). |
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% start stop API start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
|
|