From 03f21e4e7849b82bebaaa43934f7663ef95dc174 Mon Sep 17 00:00:00 2001 From: SisMaker <1713699517@qq.com> Date: Tue, 15 Feb 2022 10:01:11 +0800 Subject: [PATCH] =?UTF-8?q?st:=20=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gen_apu.erl | 86 ++++++++++++++++++++++++------------------------- src/gen_emm.erl | 2 +- src/gen_ipc.erl | 8 ++--- src/gen_srv.erl | 2 +- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/gen_apu.erl b/src/gen_apu.erl index d87a95f..ac64206 100644 --- a/src/gen_apu.erl +++ b/src/gen_apu.erl @@ -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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/gen_emm.erl b/src/gen_emm.erl index 562cad4..c78bcfe 100644 --- a/src/gen_emm.erl +++ b/src/gen_emm.erl @@ -276,7 +276,7 @@ wait_response(RequestId, Timeout) -> Return -> Return end. --spec receive_response(RequestId::requestId(), timeout()) -> {reply, Reply::term()} | 'timeout' | {error, {Reason::term(), serverRef()}}. +-spec receive_response(RequestId :: requestId(), timeout()) -> {reply, Reply :: term()} | 'timeout' | {error, {Reason :: term(), serverRef()}}. receive_response(RequestId, Timeout) -> case gen:receive_response(RequestId, Timeout) of {reply, {error, _} = Err} -> Err; diff --git a/src/gen_ipc.erl b/src/gen_ipc.erl index 21f2745..a7e1314 100644 --- a/src/gen_ipc.erl +++ b/src/gen_ipc.erl @@ -654,11 +654,11 @@ wait_response(RequestId) -> wait_response(RequestId, Timeout) -> gen:wait_response(RequestId, Timeout). --spec receive_response(RequestId::serverRef()) -> {reply, Reply::term()} | {error, {term(), serverRef()}}. +-spec receive_response(RequestId :: serverRef()) -> {reply, Reply :: term()} | {error, {term(), serverRef()}}. receive_response(RequestId) -> gen:receive_response(RequestId, infinity). --spec receive_response(RequestId::requestId(), timeout()) -> {reply, Reply::term()} | 'timeout' | {error, {term(), serverRef()}}. +-spec receive_response(RequestId :: requestId(), timeout()) -> {reply, Reply :: term()} | 'timeout' | {error, {term(), serverRef()}}. receive_response(RequestId, Timeout) -> gen:receive_response(RequestId, Timeout). @@ -1257,7 +1257,7 @@ matchEpmInfoMsg(Parent, Name, Module, HibernateAfterTimeout, IsEnter, EpmHers, P {NewEpmHers, IsHib} = doNotify(EpmHers, handleEvent, Event, false), startEpmCall(Parent, Name, Module, HibernateAfterTimeout, IsEnter, NewEpmHers, Postponed, Timers, CurStatus, CurState, NewDebug, handleEpmEvent, Event, IsHib); EpmHandler -> - {NewEpmHers, IsHib} = doEpmHandle(EpmHers, EpmHandler, handleInfo, Event, false), + {NewEpmHers, IsHib} = doEpmHandle(EpmHers, EpmHandler, handleInfo, Event, false), startEpmCall(Parent, Name, Module, HibernateAfterTimeout, IsEnter, NewEpmHers, Postponed, Timers, CurStatus, CurState, NewDebug, handleEpmInfo, Event, IsHib) end. @@ -1985,7 +1985,7 @@ listTimeouts(Timers) -> allTimer(Iterator, Acc) -> case next(Iterator) of - {TimeoutType, {_TimerRef, TimeoutMsg}, NextIterator} -> + {TimeoutType, {_TimerRef, TimeoutMsg}, NextIterator} -> allTimer(NextIterator, [{TimeoutType, TimeoutMsg} | Acc]); none -> Acc diff --git a/src/gen_srv.erl b/src/gen_srv.erl index 9d58b62..1249327 100644 --- a/src/gen_srv.erl +++ b/src/gen_srv.erl @@ -567,7 +567,7 @@ send_request(Name, Request) -> wait_response(RequestId, Timeout) -> gen:wait_response(RequestId, Timeout). --spec receive_response(RequestId::requestId(), timeout()) -> {reply, Reply::term()} | 'timeout' | {error, {Reason::term(), serverRef()}}. +-spec receive_response(RequestId :: requestId(), timeout()) -> {reply, Reply :: term()} | 'timeout' | {error, {Reason :: term(), serverRef()}}. receive_response(RequestId, Timeout) -> gen:receive_response(RequestId, Timeout).