[erlang-questions] new gproc, new feature + move to github

Pablo Platt pablo.platt@REDACTED
Thu Feb 11 23:46:58 CET 2010


got it.

thanks




________________________________
From: Ulf Wiger <ulf.wiger@REDACTED>
To: Pablo Platt <pablo.platt@REDACTED>
Cc: erlang-questions@REDACTED
Sent: Thu, February 11, 2010 6:51:58 PM
Subject: Re: [erlang-questions] new gproc, new feature + move to github

Pablo Platt wrote:
> Thank you for moving it to github and adding features.
> 
> What is the difference between gproc:await and registering a unique name with add_local_name ?

gproc:await/2 should be compared to gproc:where/1 (or the simpler
lookup_local_name/1). The lookup functions will return immediately
telling the caller whether the name is currently registered. The
await/2 function will block until the name is registered, and then
tell the caller which process registered it.

BR,
Ulf W

> 
> 
> ------------------------------------------------------------------------
> *From:* Ulf Wiger <ulf.wiger@REDACTED>
> *To:* erlang-questions@REDACTED
> *Sent:* Thu, February 11, 2010 12:46:34 PM
> *Subject:* [erlang-questions] new gproc, new feature + move to github
> 
> 
> Given the recent discussion about gproc, and my background task
> of migrating my projects to github, I have committed a new version
> of gproc:
> 
> http://svn.ulf.wiger.net/gproc/branches/0912/gproc
> 
> http://github.com/uwiger/gproc
> 
>  From now on, unless people object, I will update the git version.
> 
> 
> The new feature in this gproc version is
> 
> gproc:await(Key, Timeout) -> {Pid, Value} | error(timeout)
> 
> Currently only for local names, the function waits for a name to be
> registered and then returns the pid of the registered process.
> Given that gproc allows processes to register multiple names, this can
> serve as a simple resource broker.
> 
> There is also a non-blocking version, gproc:nb_wait(Key) -> Ref.
> Gproc will send a message, {gproc, Ref, registered, {Key, Pid, Value}}
> once the name appears.
> 
> The feature doesn't add any execution overhead to name registration,
> except when there are processes waiting for the name, in which case
> there will obviously be a cost for notifying them.
> 
> BR,
> Ulf W
> -- Ulf Wiger
> CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
> http://www.erlang-solutions.com
> ---------------------------------------------------
> 
> ---------------------------------------------------
> 
> WE'VE CHANGED NAMES!
> 
> Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
> 
> www.erlang-solutions.com <http://www.erlang-solutions.com>
> 
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org<http://erlang.org> mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED <mailto:erlang-questions-unsubscribe@REDACTED>
> 
> 


-- Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
http://www.erlang-solutions.com



      


More information about the erlang-questions mailing list