diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2020-05-12 17:42:00 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2020-07-14 03:50:28 +0300 |
| commit | 902333f10293fa1d5d1107348e58da719f273bb3 (patch) | |
| tree | 06782bb5547f21a7d5f57339c05b4af765058862 | |
| parent | 9c9301917b84f6ad6b3b844ff76523c7b3bd1903 (diff) | |
| download | rabbitmq-server-git-902333f10293fa1d5d1107348e58da719f273bb3.tar.gz | |
Introduce rabbit_networking:node_client_listeners/1
| -rw-r--r-- | src/rabbit_maintenance.erl | 43 | ||||
| -rw-r--r-- | src/rabbit_networking.erl | 14 |
2 files changed, 56 insertions, 1 deletions
diff --git a/src/rabbit_maintenance.erl b/src/rabbit_maintenance.erl new file mode 100644 index 0000000000..a40d0792d9 --- /dev/null +++ b/src/rabbit_maintenance.erl @@ -0,0 +1,43 @@ + %% The contents of this file are subject to the Mozilla Public License +%% Version 1.1 (the "License"); you may not use this file except in +%% compliance with the License. You may obtain a copy of the License +%% at https://www.mozilla.org/MPL/ +%% +%% Software distributed under the License is distributed on an "AS IS" +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +%% the License for the specific language governing rights and +%% limitations under the License. +%% +%% The Original Code is RabbitMQ. +%% +%% The Initial Developer of the Original Code is GoPivotal, Inc. +%% Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +%% + +-module(rabbit_maintenance). + + -export([ + mark_as_drained/0, + unmark_as_drained/0, + pause_all_listeners/0, + resume_all_listeners/0, + close_all_client_connections/0]). + +%% +%% API +%% + +mark_as_drained() -> + ok. + +unmark_as_drained() -> + ok. + +pause_all_listeners() -> + ok. + +resume_all_listeners() -> + ok. + +close_all_client_connections() -> + ok. diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl index d31c1e825b..278afbd087 100644 --- a/src/rabbit_networking.erl +++ b/src/rabbit_networking.erl @@ -21,7 +21,8 @@ -export([boot/0, start_tcp_listener/2, start_ssl_listener/3, stop_tcp_listener/1, on_node_down/1, active_listeners/0, - node_listeners/1, register_connection/1, unregister_connection/1, + node_listeners/1, node_client_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, @@ -297,6 +298,17 @@ active_listeners() -> node_listeners(Node) -> mnesia:dirty_read(rabbit_listener, Node). +-spec node_client_listeners(node()) -> [rabbit_types:listener()]. + +node_client_listeners(Node) -> + case node_listeners(Node) of + [] -> []; + Xs -> + lists:filter(fun (#listener{protocol = clustering}) -> false; + (_) -> true + end, Xs) + end. + -spec on_node_down(node()) -> 'ok'. on_node_down(Node) -> |
