Przeglądaj źródła

ft: 格式化代码

master
SisMaker 1 rok temu
rodzic
commit
89c6eeb30c
1 zmienionych plików z 50 dodań i 49 usunięć
  1. +50
    -49
      src/gen_apu.erl

+ 50
- 49
src/gen_apu.erl Wyświetl plik

@ -43,45 +43,45 @@
-define(STACKTRACE(), element(2, erlang:process_info(self(), current_stacktrace))). -define(STACKTRACE(), element(2, erlang:process_info(self(), current_stacktrace))).
-type serverName() :: -type serverName() ::
{'local', atom()} |
{'global', GlobalName :: term()} |
{'via', RegMod :: module(), Name :: term()}.
{'local', atom()} |
{'global', GlobalName :: term()} |
{'via', RegMod :: module(), Name :: term()}.
-type serverRef() :: -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() :: -type startOpt() ::
daemon |
{'timeout', Time :: timeout()} |
{'spawn_opt', [proc_lib:spawn_option()]} |
enterLoopOpt().
daemon |
{'timeout', Time :: timeout()} |
{'spawn_opt', [proc_lib:spawn_option()]} |
enterLoopOpt().
-type enterLoopOpt() :: -type enterLoopOpt() ::
{'debug', Debugs :: [sys:debug_option()]} |
{'hibernate_after', HibernateAfterTimeout :: timeout()}.
{'debug', Debugs :: [sys:debug_option()]} |
{'hibernate_after', HibernateAfterTimeout :: timeout()}.
-type startRet() :: -type startRet() ::
'ignore' |
{'ok', pid()} |
{'ok', {pid(), reference()}} |
{'error', term()}.
'ignore' |
{'ok', pid()} |
{'ok', {pid(), reference()}} |
{'error', term()}.
-type action() :: -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() :: -type actions() ::
action() |
[action(), ...].
action() |
[action(), ...].
-type timeouts() :: Time :: timeout() | integer(). -type timeouts() :: Time :: timeout() | integer().
-type timeoutOption() :: {abs, Abs :: boolean()}. -type timeoutOption() :: {abs, Abs :: boolean()}.
@ -92,7 +92,7 @@ action() |
-type requestId() :: term(). -type requestId() :: term().
-type replyAction() :: -type replyAction() ::
{'reply', From :: from(), Reply :: term()}.
{'reply', From :: from(), Reply :: term()}.
-callback init(Args :: term()) -> -callback init(Args :: term()) ->
{ok, State :: term()} | {ok, State :: term()} |
@ -103,25 +103,25 @@ action() |
%% call %% call
-export_type([handleCallRet/0]). -export_type([handleCallRet/0]).
-type handleCallRet() :: -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()} |
{mayReply, Reply :: term()} |
{mayReply, Reply :: term(), NewState :: term()} |
{mayReply, Reply :: term(), 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()} |
{mayReply, Reply :: term()} |
{mayReply, Reply :: term(), NewState :: term()} |
{mayReply, Reply :: term(), NewState :: term(), Actions :: actions()} |
{stop, Reason :: term(), NewState :: term()} |
{stopReply, Reason :: term(), Reply :: term(), NewState :: term()}.
%% cast %% cast
-export_type([handleCastRet/0]). -export_type([handleCastRet/0]).
-type handleCastRet() :: -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()) -> -callback handleInfo(Info :: timeout | term(), State :: term()) ->
kpS | kpS |
@ -155,11 +155,12 @@ kpS |
Status :: term(). Status :: term().
-optional_callbacks([ -optional_callbacks([
handleAfter/2
, handleInfo/2
, terminate/2
, code_change/3
, formatStatus/2
handleAfter/2
, handleInfo/2
, handleError/2
, terminate/2
, code_change/3
, formatStatus/2
]). ]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% start stop API start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% start stop API start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -740,7 +741,7 @@ receiveIng(Parent, Name, Module, GbhOpts, HibernateAfterTimeout, Debug, Timers,
matchInfoMsg(Parent, Name, Module, GbhOpts, HibernateAfterTimeout, Debug, Timers, CurState, Msg) matchInfoMsg(Parent, Name, Module, GbhOpts, HibernateAfterTimeout, Debug, Timers, CurState, Msg)
end end
after HibernateAfterTimeout -> after HibernateAfterTimeout ->
proc_lib:hibernate(?MODULE, wakeupFromHib, [Parent, Name, Module, GbhOpts, HibernateAfterTimeout, Debug, Timers, CurState])
proc_lib:hibernate(?MODULE, wakeupFromHib, [Parent, Name, Module, GbhOpts, HibernateAfterTimeout, Debug, Timers, CurState, IsHib])
end. end.
matchCallMsg(Parent, Name, Module, GbhOpts, HibernateAfterTimeout, Debug, Timers, CurState, From, Request) -> matchCallMsg(Parent, Name, Module, GbhOpts, HibernateAfterTimeout, Debug, Timers, CurState, From, Request) ->

Ładowanie…
Anuluj
Zapisz