Roberto Ostinelli 3 лет назад
Родитель
Сommit
b8fb2e0a97
3 измененных файлов с 9 добавлено и 9 удалено
  1. 4 4
      src/syn.erl
  2. 3 3
      src/syn_groups.erl
  3. 2 2
      test/syn_groups_SUITE.erl

+ 4 - 4
src/syn.erl

@@ -716,7 +716,7 @@ multi_call(Scope, GroupName, Message) ->
 %%
 %% When this call is issued, all members will receive a tuple in the format:
 %%
-%% `{syn_multi_call, CallerPid, Message}'
+%% `{syn_multi_call, TestMessage, Caller, Meta}'
 %%
 %% To reply, every member MUST use the method {@link multi_call_reply/2}.
 %%
@@ -734,6 +734,6 @@ multi_call(Scope, GroupName, Message, Timeout) ->
 %% @doc Allows a group member to reply to a multi call.
 %%
 %% See {@link multi_call/4} for info.
--spec multi_call_reply(CallerPid :: pid(), Reply :: any()) -> {syn_multi_call_reply, pid(), Reply :: any()}.
-multi_call_reply(CallerPid, Reply) ->
-    syn_groups:multi_call_reply(CallerPid, Reply).
+-spec multi_call_reply(Caller :: term(), Reply :: any()) -> {syn_multi_call_reply, pid(), Reply :: any()}.
+multi_call_reply(Caller, Reply) ->
+    syn_groups:multi_call_reply(Caller, Reply).

+ 3 - 3
src/syn_groups.erl

@@ -301,9 +301,9 @@ multi_call(Scope, GroupName, Message, Timeout) ->
     end, Members),
     collect_replies(orddict:from_list(Members)).
 
--spec multi_call_reply(CallerPid :: pid(), Reply :: term()) -> {syn_multi_call_reply, pid(), Reply :: term()}.
-multi_call_reply({Ref, ClientPid}, Reply) ->
-    ClientPid ! {syn_multi_call_reply, Ref, Reply}.
+-spec multi_call_reply({reference(), ClientPid :: pid()}, Reply :: term()) -> {syn_multi_call_reply, pid(), Reply :: term()}.
+multi_call_reply({Ref, CallerPid}, Reply) ->
+    CallerPid ! {syn_multi_call_reply, Ref, Reply}.
 
 %% ===================================================================
 %% Callbacks

+ 2 - 2
test/syn_groups_SUITE.erl

@@ -2206,7 +2206,7 @@ subscriber_loop(TestPid, TestMessage) ->
 
 recipient_loop() ->
     receive
-        {syn_multi_call, TestMessage, CallerPid, Meta} ->
-            syn:multi_call_reply(CallerPid, {reply, TestMessage, self(), Meta}),
+        {syn_multi_call, TestMessage, Caller, Meta} ->
+            syn:multi_call_reply(Caller, {reply, TestMessage, self(), Meta}),
             recipient_loop()
     end.