[erlang-questions] conditional pub-sub in gproc
Sat Jun 16 02:58:33 CEST 2012
Please try out the latest version, which includes a few new functions:
gproc:await(Node, Key, Timeout)
gproc:wide_await(Nodes, Key, Timeout)
gproc:cancel_wait(Node, Key, Ref)
Note that await/3 also returns the Value, so can be throught of as a
distributed get_value() function.
On 15 Jun 2012, at 16:25, Loïc Hoguin wrote:
> Sorry I should have been clearer.
> I'm using global gproc to locate processes that may be on any node of the cluster. But sometimes I run into gen_leader's issues (for example if a node crashes) so I was wondering if I could manage still using gproc for my purposes without gen_leader.
> Currently it's easy to broadcast information to other local gprocs but not so much to retrieve remote data, similar to what get_value/2 or where/1 would do in a distributed context.
> It would be nice to be able to have a cluster of local gprocs and easily access them from any remote node, similar to how bcast works for broadcasting.
> On 06/16/2012 01:18 AM, Ulf Wiger wrote:
>> On 15 Jun 2012, at 16:10, Loïc Hoguin wrote:
>>> That removes some functionality though, doesn't it. Like :get_value/1 and where/1. How would you suggest using these without global gproc?
>> Uhm, those functions work perfectly fine in a local context…
>> Can you expand on that?
>> Global gproc (gproc_dist) is disabled by default.
>> My assumption is that most people leave it that way.
>> Ulf W
>> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
> Loïc Hoguin
> Erlang Cowboy
> Nine Nines
Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
More information about the erlang-questions