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

Ulf Wiger <>
Thu Feb 11 17:51:58 CET 2010


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 <>
> *To:* 
> *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: 
> <mailto:>
> 
> 


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


More information about the erlang-questions mailing list