diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2018-11-30 11:30:36 +0100 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2019-02-01 11:23:16 +0100 |
| commit | 5bbde6d0a3eb1790d4965d76c8699d0187b74183 (patch) | |
| tree | df1cd4f48442a8e79d45e35c255cd28851dee63d /src/gatherer.erl | |
| parent | d142bbc45a4d0f8482b6a98d1f16a725cdf8d8a8 (diff) | |
| download | rabbitmq-server-git-5bbde6d0a3eb1790d4965d76c8699d0187b74183.tar.gz | |
Move `-spec()` near their function
Diffstat (limited to 'src/gatherer.erl')
| -rw-r--r-- | src/gatherer.erl | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/gatherer.erl b/src/gatherer.erl index a8b55892c1..1625468a52 100644 --- a/src/gatherer.erl +++ b/src/gatherer.erl @@ -39,16 +39,6 @@ %%---------------------------------------------------------------------------- --spec start_link() -> rabbit_types:ok_pid_or_error(). --spec stop(pid()) -> 'ok'. --spec fork(pid()) -> 'ok'. --spec finish(pid()) -> 'ok'. --spec in(pid(), any()) -> 'ok'. --spec sync_in(pid(), any()) -> 'ok'. --spec out(pid()) -> {'value', any()} | 'empty'. - -%%---------------------------------------------------------------------------- - -define(HIBERNATE_AFTER_MIN, 1000). -define(DESIRED_HIBERNATE, 10000). @@ -58,24 +48,38 @@ %%---------------------------------------------------------------------------- +-spec start_link() -> rabbit_types:ok_pid_or_error(). + start_link() -> gen_server2:start_link(?MODULE, [], [{timeout, infinity}]). +-spec stop(pid()) -> 'ok'. + stop(Pid) -> gen_server2:call(Pid, stop, infinity). +-spec fork(pid()) -> 'ok'. + fork(Pid) -> gen_server2:call(Pid, fork, infinity). +-spec finish(pid()) -> 'ok'. + finish(Pid) -> gen_server2:cast(Pid, finish). +-spec in(pid(), any()) -> 'ok'. + in(Pid, Value) -> gen_server2:cast(Pid, {in, Value}). +-spec sync_in(pid(), any()) -> 'ok'. + sync_in(Pid, Value) -> gen_server2:call(Pid, {in, Value}, infinity). +-spec out(pid()) -> {'value', any()} | 'empty'. + out(Pid) -> gen_server2:call(Pid, out, infinity). |
