summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Corbacho <diana.corbacho@erlang-solutions.com>2016-02-26 16:47:54 +0000
committerDiana Corbacho <diana.corbacho@erlang-solutions.com>2016-02-26 16:47:54 +0000
commit7caacbb67f5ea1429aae4e4a0c372ca6e93d0a51 (patch)
treece5a0224c5556d8af2792a5db5a0c66d427b2635
parente6cea86b4d4db00b182083a1ed34f8e0c8336415 (diff)
downloadrabbitmq-server-git-7caacbb67f5ea1429aae4e4a0c372ca6e93d0a51.tar.gz
Restore rabbit_cli:rpc_call API
-rw-r--r--src/rabbit_cli.erl19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/rabbit_cli.erl b/src/rabbit_cli.erl
index b9b15b20a4..6679d9329e 100644
--- a/src/rabbit_cli.erl
+++ b/src/rabbit_cli.erl
@@ -18,7 +18,7 @@
-include("rabbit_cli.hrl").
-export([main/3, start_distribution/0, start_distribution/1,
- parse_arguments/4]).
+ parse_arguments/4, rpc_call/4, rpc_call/5, rpc_call/7]).
%%----------------------------------------------------------------------------
@@ -38,6 +38,10 @@
-spec(parse_arguments/4 ::
([{atom(), [{string(), optdef()}]} | atom()],
[{string(), optdef()}], string(), [string()]) -> parse_result()).
+-spec(rpc_call/4 :: (node(), atom(), atom(), [any()]) -> any()).
+-spec(rpc_call/5 :: (node(), atom(), atom(), [any()], number()) -> any()).
+-spec(rpc_call/7 :: (node(), atom(), atom(), [any()], reference(), pid(),
+ number()) -> any()).
-endif.
@@ -245,3 +249,16 @@ print_error(Format, Args) -> fmt_stderr("Error: " ++ Format, Args).
print_badrpc_diagnostics(Nodes) ->
fmt_stderr(rabbit_nodes:diagnostics(Nodes), []).
+
+%% If the server we are talking to has non-standard net_ticktime, and
+%% our connection lasts a while, we could get disconnected because of
+%% a timeout unless we set our ticktime to be the same. So let's do
+%% that.
+rpc_call(Node, Mod, Fun, Args) ->
+ rabbit_misc:rpc_call(Node, Mod, Fun, Args).
+
+rpc_call(Node, Mod, Fun, Args, Timeout) ->
+ rabbit_misc:rpc_call(Node, Mod, Fun, Args, Timeout).
+
+rpc_call(Node, Mod, Fun, Args, Ref, Pid, Timeout) ->
+ rabbit_misc:rpc_call(Node, Mod, Fun, Args, Ref, Pid, Timeout).