summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2013-08-17 12:05:19 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2013-08-17 12:05:19 +0100
commit26fe3d9ba9026015e39211916fa8a9e92df0671d (patch)
treee6fb9d5fb829ed2bfb14a2fc66eda78a8c1ce6ee
parent01664aed1d4f49f0dccc9d2e29d36d5c1513e694 (diff)
downloadrabbitmq-server-26fe3d9ba9026015e39211916fa8a9e92df0671d.tar.gz
we only support process monitoring, so enforce that in the API
-rw-r--r--src/delegate.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/delegate.erl b/src/delegate.erl
index 9642e9ca..5ed31d08 100644
--- a/src/delegate.erl
+++ b/src/delegate.erl
@@ -124,11 +124,11 @@ invoke_no_result(Pids, FunOrMFA) when is_list(Pids) ->
safe_invoke(LocalPids, FunOrMFA), %% must not die
ok.
-monitor(Type, Pid) when node(Pid) =:= node() ->
- erlang:monitor(Type, Pid);
-monitor(Type, Pid) ->
+monitor(process, Pid) when node(Pid) =:= node() ->
+ erlang:monitor(process, Pid);
+monitor(process, Pid) ->
Name = delegate(Pid, [node(Pid)]),
- gen_server2:cast(Name, {monitor, Type, self(), Pid}),
+ gen_server2:cast(Name, {monitor, self(), Pid}),
{Name, Pid}.
demonitor(Ref) -> ?MODULE:demonitor(Ref, []).
@@ -192,14 +192,14 @@ handle_call({invoke, FunOrMFA, Grouped}, _From, State = #state{node = Node}) ->
{reply, safe_invoke(orddict:fetch(Node, Grouped), FunOrMFA), State,
hibernate}.
-handle_cast({monitor, Type, WantsMonitor, Pid},
+handle_cast({monitor, WantsMonitor, Pid},
State = #state{monitors = Monitors}) ->
Monitors1 = case dict:find(Pid, Monitors) of
{ok, {Ref, Set}} ->
Set1 = sets:add_element(WantsMonitor, Set),
dict:store(Pid, {Ref, Set1}, Monitors);
error ->
- Ref = erlang:monitor(Type, Pid),
+ Ref = erlang:monitor(process, Pid),
Set = sets:from_list([WantsMonitor]),
dict:store(Pid, {Ref, Set}, Monitors)
end,