Permalink
Browse files

documentation fixes (esp gproc:select/[1,2])

  • Loading branch information...
1 parent c60b9b4 commit efeaf8b625880868d0682ba616a98a16e67324e9 @uwiger committed May 11, 2012
Showing with 190 additions and 361 deletions.
  1. +13 −44 README.md
  2. +13 −44 doc/README.md
  3. +77 −156 doc/gproc.md
  4. +2 −4 doc/gproc_dist.md
  5. +1 −1 doc/gproc_lib.md
  6. +6 −12 doc/gproc_monitor.md
  7. +27 −73 doc/gproc_ps.md
  8. +10 −10 doc/overview.edoc
  9. +1 −0 rebar.config
  10. +37 −14 src/gproc.erl
  11. +1 −1 src/gproc_dist.erl
  12. +1 −1 src/gproc_lib.erl
  13. +1 −1 src/gproc_ps.erl
View
@@ -7,60 +7,44 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla
Extended process dictionary
-
-
##Introduction##
-
-
Gproc is a process dictionary for Erlang, which provides a number of useful features beyond what the built-in dictionary has:
-
-
* Use any term as a process alias
* Register a process under several aliases
* Non-unique properties can be registered simultaneously by many processes
-* QLC and match specification interface for efficient queries on the
+* QLC and match specification interface for efficient queries on the
dictionary
* Await registration, let's you wait until a process registers itself
* Atomically give away registered names and properties to another process
-* Counters, and aggregated counters, which automatically maintain the
+* Counters, and aggregated counters, which automatically maintain the
total of all counters with a given name
* Global registry, with all the above functions applied to a network of nodes
-
-
###Use case: System inspection##
-
-
Gproc was designed to work as a central index for "process metadata", i.e.
properties that describe the role and characteristics of each process. Having
a single registry that is flexible enough to hold important types of property
-makes it easier to (a) find processes of a certain type, and (b) query and
+makes it easier to (a) find processes of a certain type, and (b) query and
browse key data in a running system.
-
-
###Use case: Pub/Sub patterns##
-
-
An interesting application of gproc is building publish/subscribe patterns.
-Example:
-
-<pre>
+Example:<pre>
subscribe(EventType) ->
%% Gproc notation: {p, l, Name} means {(p)roperty, (l)ocal, Name}
gproc:reg({p, l, {?MODULE, EventType}}).
@@ -70,49 +54,34 @@ notify(EventType, Msg) ->
gproc:send({p, l, Key}, {self(), Key, Msg}).
</pre>
-
-
###Use case: Environment handling##
-
-
Gproc provides a set of functions to read environment variables, possibly from
alternative sources, and cache them for efficient lookup. Caching also provides
-a way to see which processes rely on certain configuration values, as well as
-which values they actually ended up using.
+a way to see which processes rely on certain configuration values, as well as
+which values they actually ended up using.
-
-
-See [`gproc:get_env/4`](http://github.com/esl/gproc/blob/master/doc/gproc.md#get_env-4), [`gproc:get_set_env/4`](http://github.com/esl/gproc/blob/master/doc/gproc.md#get_set_env-4) and
+See [`gproc:get_env/4`](http://github.com/esl/gproc/blob/master/doc/gproc.md#get_env-4), [`gproc:get_set_env/4`](http://github.com/esl/gproc/blob/master/doc/gproc.md#get_set_env-4) and
[`gproc:set_env/5`](http://github.com/esl/gproc/blob/master/doc/gproc.md#set_env-5) for details.
-
-
##Testing##
-
-
-Gproc has a QuickCheck test suite, covering a fairly large part of the local
-gproc functionality, although none of the global registry. It requires a
-commercial EQC license, but rebar is smart enough to detect whether EQC is
+Gproc has a QuickCheck test suite, covering a fairly large part of the local
+gproc functionality, although none of the global registry. It requires a
+commercial EQC license, but rebar is smart enough to detect whether EQC is
available, and if it isn't, the code in gproc_eqc.erl will be "defined away".
-
-
-There is also an eunit suite, covering the basic operations for local and
+There is also an eunit suite, covering the basic operations for local and
global gproc.
-
-
##Building Edoc##
-By default, `./rebar doc` generates Github-flavored Markdown files.If you want to change this, remove the `edoc_opts` line from `rebar.config`.
-
-Gproc was first introduced at the ACM SIGPLAN Erlang Workshop in
+By default, `./rebar doc` generates Github-flavored Markdown files.
+If you want to change this, remove the `edoc_opts` line from `rebar.config`.Gproc was first introduced at the ACM SIGPLAN Erlang Workshop in
Freiburg 2007 ([Paper available here](http://github.com/esl/gproc/blob/master/doc/erlang07-wiger.pdf)).
View
@@ -7,60 +7,44 @@ __Authors:__ Ulf Wiger ([`ulf.wiger@erlang-solutions.com`](mailto:ulf.wiger@erla
Extended process dictionary
-
-
##Introduction##
-
-
Gproc is a process dictionary for Erlang, which provides a number of useful features beyond what the built-in dictionary has:
-
-
* Use any term as a process alias
* Register a process under several aliases
* Non-unique properties can be registered simultaneously by many processes
-* QLC and match specification interface for efficient queries on the
+* QLC and match specification interface for efficient queries on the
dictionary
* Await registration, let's you wait until a process registers itself
* Atomically give away registered names and properties to another process
-* Counters, and aggregated counters, which automatically maintain the
+* Counters, and aggregated counters, which automatically maintain the
total of all counters with a given name
* Global registry, with all the above functions applied to a network of nodes
-
-
###Use case: System inspection##
-
-
Gproc was designed to work as a central index for "process metadata", i.e.
properties that describe the role and characteristics of each process. Having
a single registry that is flexible enough to hold important types of property
-makes it easier to (a) find processes of a certain type, and (b) query and
+makes it easier to (a) find processes of a certain type, and (b) query and
browse key data in a running system.
-
-
###Use case: Pub/Sub patterns##
-
-
An interesting application of gproc is building publish/subscribe patterns.
-Example:
-
-<pre>
+Example:<pre>
subscribe(EventType) ->
%% Gproc notation: {p, l, Name} means {(p)roperty, (l)ocal, Name}
gproc:reg({p, l, {?MODULE, EventType}}).
@@ -70,49 +54,34 @@ notify(EventType, Msg) ->
gproc:send({p, l, Key}, {self(), Key, Msg}).
</pre>
-
-
###Use case: Environment handling##
-
-
Gproc provides a set of functions to read environment variables, possibly from
alternative sources, and cache them for efficient lookup. Caching also provides
-a way to see which processes rely on certain configuration values, as well as
-which values they actually ended up using.
+a way to see which processes rely on certain configuration values, as well as
+which values they actually ended up using.
-
-
-See [`gproc:get_env/4`](gproc.md#get_env-4), [`gproc:get_set_env/4`](gproc.md#get_set_env-4) and
+See [`gproc:get_env/4`](gproc.md#get_env-4), [`gproc:get_set_env/4`](gproc.md#get_set_env-4) and
[`gproc:set_env/5`](gproc.md#set_env-5) for details.
-
-
##Testing##
-
-
-Gproc has a QuickCheck test suite, covering a fairly large part of the local
-gproc functionality, although none of the global registry. It requires a
-commercial EQC license, but rebar is smart enough to detect whether EQC is
+Gproc has a QuickCheck test suite, covering a fairly large part of the local
+gproc functionality, although none of the global registry. It requires a
+commercial EQC license, but rebar is smart enough to detect whether EQC is
available, and if it isn't, the code in gproc_eqc.erl will be "defined away".
-
-
-There is also an eunit suite, covering the basic operations for local and
+There is also an eunit suite, covering the basic operations for local and
global gproc.
-
-
##Building Edoc##
-By default, `./rebar doc` generates Github-flavored Markdown files.If you want to change this, remove the `edoc_opts` line from `rebar.config`.
-
-Gproc was first introduced at the ACM SIGPLAN Erlang Workshop in
+By default, `./rebar doc` generates Github-flavored Markdown files.
+If you want to change this, remove the `edoc_opts` line from `rebar.config`.Gproc was first introduced at the ACM SIGPLAN Erlang Workshop in
Freiburg 2007 ([Paper available here](erlang07-wiger.pdf)).
Oops, something went wrong.

0 comments on commit efeaf8b

Please sign in to comment.