summaryrefslogtreecommitdiff
path: root/src/fabric_util.erl
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-06-01 10:58:17 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-06-01 10:58:17 -0400
commitbd976a5a78ba88a25996fc7e94c22e8a8925ccec (patch)
tree4a3ee571dd3a937b166ee246473bce2b71b55885 /src/fabric_util.erl
parent9b7831dbbddc97b4134be2fa3b3ec2d2ebc9462b (diff)
add sync_reply, change msg format to be more like gen_server
Diffstat (limited to 'src/fabric_util.erl')
-rw-r--r--src/fabric_util.erl14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/fabric_util.erl b/src/fabric_util.erl
index b6d68e09..dd1aaf0a 100644
--- a/src/fabric_util.erl
+++ b/src/fabric_util.erl
@@ -55,10 +55,16 @@ process_message(RefList, Keypos, Fun, Acc0, TimeoutRef, PerMsgTO) ->
false ->
% this was some non-matching message which we will ignore
{ok, Acc0};
- RefPart ->
- % call the Fun that understands the message
- %?debugFmt("~nAcc0: ~p~n", [Acc0]),
- Fun(RefPart, Msg, Acc0)
+ Worker ->
+ Fun(Msg, Worker, Acc0)
+ end;
+ {Ref, From, Msg} ->
+ io:format("process sync_reply {~p,~p} ~p~n", [Ref, From, Msg]),
+ case lists:keyfind(Ref, Keypos, RefList) of
+ false ->
+ {ok, Acc0};
+ Worker ->
+ Fun(Msg, {Worker, From}, Acc0)
end;
{rexi_DOWN, _RexiMonPid, ServerPid, Reason} = Msg ->
showroom_log:message(alert, "rexi_DOWN ~p ~p", [ServerPid, Reason]),