[erlang-questions] Confusing about gproc with global properties

Ulf Wiger ulf.wiger@REDACTED
Sat Apr 16 21:39:13 CEST 2011


Thinking about it, I'd like to change gproc:select/1 to also include global objects, in other words:

select(Pat) -> select({all, all}, Pat).

This is a backwards incompatible change, but I am guessing that not too many people use the global gproc functionality yet, so this should be the time to do it.

Any objections?

BR,
Ulf W

On 16 Apr 2011, at 02:52, Gregory Haskins wrote:

> On 4/15/11 5:25 PM, Ulf Wiger wrote:
>> 
>> Hi Greg,
>> 
>> Yeah, gproc:select/1 is a bit confusing.
>> 
>> It is actually equivalent to gproc:select(all, Pat), where the first argument is the type (names, properties, etc.) - not the scope.
>> 
>> Not that you'd know this from reading the docs, but you can do this:
>> 
>> (n1@REDACTED)21> gproc:select({global,all},[{'_',[],['$$']}]).      
>> [[{p,g,foo},<0.37.0>,bar]]
>> (n1@REDACTED)22> gproc:select({local,all},[{'_',[],['$$']}]). 
>> [[{p,l,foo},<0.37.0>,bar]]
>> (n1@REDACTED)23> gproc:select({all,all},[{'_',[],['$$']}]).  
>> [[{p,g,foo},<0.37.0>,bar],[{p,l,foo},<0.37.0>,bar]]
>> 
>> The {Scope, Type} tuple is, I think wholly undocumented.
>> 
>> I'll go over the type specs and the documentation on that one. Thanks for highlighting it.
>> 
> 
> Thanks Ulf, worked like a champ!  And the schema translates to the QLC
> interface, too, I see.  I have now officially converted over to using gproc:
> 
> https://github.com/ghaskins/edist/commit/e8c080de766b23a801d3865442fac72c9045b453
> 
> Thanks for the help, and the great library.
> 
> Kind Regards,
> -Greg
> 

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com






More information about the erlang-questions mailing list