Skip to content

Instantly share code, notes, and snippets.

@lucian
Last active July 24, 2018 07:40
Show Gist options
  • Save lucian/63c807a23a7210a78cabe64643219f59 to your computer and use it in GitHub Desktop.
Save lucian/63c807a23a7210a78cabe64643219f59 to your computer and use it in GitHub Desktop.
gproc example queries
%% Gproc Example queries
1> Table = gproc:table().
{qlc_handle,{qlc_table,#Fun<gproc.13.93641566>,true,
undefined,undefined,#Fun<gproc.16.93641566>,undefined,
#Fun<gproc.17.93641566>,undefined,'=:=',undefined,
no_match_spec}}
%% query all registered gproc local names
2> Q_names = qlc:q([{X, P} || {{n,l,X},P,_} <- Table]).
{qlc_handle,{qlc_lc,#Fun<erl_eval.20.99386804>,
{qlc_opt,false,false,-1,any,[],any,524288,allowed}}}
%% query all registered gproc local properties
2> Q_props = qlc:q([{X, P} || {{p,l,X},P,_} <- Table]).
{qlc_handle,{qlc_lc,#Fun<erl_eval.20.99386804>,
{qlc_opt,false,false,-1,any,[],any,524288,allowed}}}
3> qlc:e(Q_names).
...
4> qlc:e(Q_props).
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment