[erlang-questions] [gproc] How to broadcast message to all other processes except self
Tue Dec 4 17:35:06 CET 2012
it's solved. thank you!
On Wed, Dec 5, 2012 at 12:19 AM, Barco You <barcojie@REDACTED> wrote:
> Thank you for replying. But I tried to use Pid ! Msg, but seemingly can
> not receive message as gproc:send(Key, Msg).
> On Tue, Dec 4, 2012 at 9:31 PM, Ulf Wiger <ulf@REDACTED> wrote:
>> The function gproc:send/2, when used on a non-unique key, in essence does
>> lists:foreach(fun(Pid) ->
>> Pid ! Msg
>> end, gproc:lookup_pids(Key)),
>> So you can take that as a starting point, and add a clause that
>> pattern-matches on the own pid, and then doesn't send a message in that
>> Ulf W
>> On 4 Dec 2012, at 13:21, Barco You wrote:
>> Dear All,
>> I use gproc:reg to register all the processes to a KEY and through gproc:send(KEY,
>> MSG) I can broadcast message to all the processes, including myself. But
>> now I hope to send message to all the other processes except myself. How
>> can I do it? Could you please illuminate ? Thank you.
>> erlang-questions mailing list
>> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions