diff options
| author | Ayanda Dube <ayanda.dube@erlang-solutions.com> | 2015-09-08 16:56:57 +0100 |
|---|---|---|
| committer | Ayanda Dube <ayanda.dube@erlang-solutions.com> | 2015-10-07 08:46:40 +0100 |
| commit | 84b91e200f57c899acac7a2bc5a571ddbd9c8abe (patch) | |
| tree | f23f8e64457642cc5edcf8fe5cd3c7226af2e6c0 /src | |
| parent | ed1a42feb501e7d03f9386ddda5631e93bde1fdc (diff) | |
| download | rabbitmq-server-git-84b91e200f57c899acac7a2bc5a571ddbd9c8abe.tar.gz | |
Adds connection_info_all/3 for dynamic display of connections.
References #62
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_networking.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl index f95f8c5818..972b2e31cf 100644 --- a/src/rabbit_networking.erl +++ b/src/rabbit_networking.erl @@ -21,7 +21,7 @@ node_listeners/1, register_connection/1, unregister_connection/1, connections/0, connection_info_keys/0, connection_info/1, connection_info/2, - connection_info_all/0, connection_info_all/1, + connection_info_all/0, connection_info_all/1, connection_info_all/3, close_connection/2, force_connection_event_refresh/1, tcp_host/1]). %%used by TCP-based transports, e.g. STOMP adapter @@ -82,6 +82,8 @@ -spec(connection_info_all/0 :: () -> [rabbit_types:infos()]). -spec(connection_info_all/1 :: (rabbit_types:info_keys()) -> [rabbit_types:infos()]). +-spec(connection_info_all/3 :: + (rabbit_types:info_keys(), reference(), pid()) -> 'ok'). -spec(close_connection/2 :: (pid(), string()) -> 'ok'). -spec(force_connection_event_refresh/1 :: (reference()) -> 'ok'). @@ -440,6 +442,11 @@ connection_info(Pid, Items) -> rabbit_reader:info(Pid, Items). connection_info_all() -> cmap(fun (Q) -> connection_info(Q) end). connection_info_all(Items) -> cmap(fun (Q) -> connection_info(Q, Items) end). +connection_info_all(Items, Ref, Pid) -> + cmap(fun (Q) -> Pid ! {Ref, connection_info(Q, Items)} end), + Pid ! {Ref, finished}, + ok. + close_connection(Pid, Explanation) -> rabbit_log:info("Closing connection ~p because ~p~n", [Pid, Explanation]), case lists:member(Pid, connections()) of |
