ソースを参照

st: 代码格式化

master
SisMaker 3年前
コミット
03f21e4e78
4個のファイルの変更49行の追加49行の削除
  1. +43
    -43
      src/gen_apu.erl
  2. +1
    -1
      src/gen_emm.erl
  3. +4
    -4
      src/gen_ipc.erl
  4. +1
    -1
      src/gen_srv.erl

+ 43
- 43
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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

+ 1
- 1
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;

+ 4
- 4
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

+ 1
- 1
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).

読み込み中…
キャンセル
保存