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

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


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 ?





________________________________
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


________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED


      


More information about the erlang-questions mailing list