diff options
author | Tim Watson <tim@rabbitmq.com> | 2014-01-29 10:44:07 +0000 |
---|---|---|
committer | Tim Watson <tim@rabbitmq.com> | 2014-01-29 10:44:07 +0000 |
commit | 3a300eaf8327e2780e5675bb3a0f7a482f3cd663 (patch) | |
tree | fe8412d9d049886a1034a17667bb80c27277d29f | |
parent | 1bd2ab88d27cd4e0ae5c0c137a7d6d96b3c5581d (diff) | |
download | rabbitmq-server-3a300eaf8327e2780e5675bb3a0f7a482f3cd663.tar.gz |
Remove rabbit_misc:multi_call/2
-rw-r--r-- | src/rabbit_misc.erl | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 80e160d9..a3fd068f 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -59,7 +59,6 @@ -export([pget/2, pget/3, pget_or_die/2, pset/3]). -export([format_message_queue/2]). -export([append_rpc_all_nodes/4]). --export([multi_call/2]). -export([os_cmd/1]). -export([gb_sets_difference/2]). -export([version/0, which_applications/0]). @@ -229,8 +228,6 @@ -spec(pset/3 :: (term(), term(), [term()]) -> term()). -spec(format_message_queue/2 :: (any(), priority_queue:q()) -> term()). -spec(append_rpc_all_nodes/4 :: ([node()], atom(), atom(), [any()]) -> [any()]). --spec(multi_call/2 :: - ([pid()], any()) -> {[{pid(), any()}], [{pid(), any()}]}). -spec(os_cmd/1 :: (string()) -> string()). -spec(gb_sets_difference/2 :: (gb_set(), gb_set()) -> gb_set()). -spec(version/0 :: () -> string()). @@ -947,31 +944,6 @@ append_rpc_all_nodes(Nodes, M, F, A) -> _ -> Res end || Res <- ResL]). -%% A simplified version of gen_server:multi_call/2 with a sane -%% API. This is not in gen_server2 as there is no useful -%% infrastructure there to share. -multi_call(Pids, Req) -> - MonitorPids = [start_multi_call(Pid, Req) || Pid <- Pids], - receive_multi_call(MonitorPids, [], []). - -start_multi_call(Pid, Req) when is_pid(Pid) -> - Mref = erlang:monitor(process, Pid), - Pid ! {'$gen_call', {self(), Mref}, Req}, - {Mref, Pid}. - -receive_multi_call([], Good, Bad) -> - {lists:reverse(Good), lists:reverse(Bad)}; -receive_multi_call([{Mref, Pid} | MonitorPids], Good, Bad) -> - receive - {Mref, Reply} -> - erlang:demonitor(Mref, [flush]), - receive_multi_call(MonitorPids, [{Pid, Reply} | Good], Bad); - {'DOWN', Mref, _, _, noconnection} -> - receive_multi_call(MonitorPids, Good, [{Pid, nodedown} | Bad]); - {'DOWN', Mref, _, _, Reason} -> - receive_multi_call(MonitorPids, Good, [{Pid, Reason} | Bad]) - end. - os_cmd(Command) -> case os:type() of {win32, _} -> |