Ulf Wiger 9 лет назад
Родитель
Сommit
133924157d
14 измененных файлов с 153 добавлено и 612 удалено
  1. 2 1
      README.md
  2. 2 1
      doc/README.md
  3. 89 306
      doc/gproc.md
  4. 1 3
      doc/gproc_app.md
  5. 2 10
      doc/gproc_bcast.md
  6. 6 43
      doc/gproc_dist.md
  7. 1 2
      doc/gproc_info.md
  8. 0 5
      doc/gproc_init.md
  9. 3 32
      doc/gproc_lib.md
  10. 4 14
      doc/gproc_monitor.md
  11. 23 96
      doc/gproc_pool.md
  12. 16 89
      doc/gproc_ps.md
  13. 2 9
      doc/gproc_pt.md
  14. 2 1
      doc/gproc_sup.md

+ 2 - 1
README.md

@@ -97,9 +97,9 @@ 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
 Freiburg 2007 ([Paper available here](http://github.com/uwiger/gproc/blob/master/doc/erlang07-wiger.pdf)).
 
@@ -120,3 +120,4 @@ Freiburg 2007 ([Paper available here](http://github.com/uwiger/gproc/blob/master
 <tr><td><a href="http://github.com/uwiger/gproc/blob/master/doc/gproc_ps.md" class="module">gproc_ps</a></td></tr>
 <tr><td><a href="http://github.com/uwiger/gproc/blob/master/doc/gproc_pt.md" class="module">gproc_pt</a></td></tr>
 <tr><td><a href="http://github.com/uwiger/gproc/blob/master/doc/gproc_sup.md" class="module">gproc_sup</a></td></tr></table>
+

+ 2 - 1
doc/README.md

@@ -7,6 +7,7 @@ __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)), Joseph Wayne N
 Extended process dictionary
 
 [![Build Status](https://travis-ci.org/uwiger/gproc.png?branch=master)](https://travis-ci.org/uwiger/gproc)
+[![Hex pm](http://img.shields.io/hexpm/v/gproc.svg?style=flat)](https://hex.pm/packages/gproc)
 
 
 ## Note ##
@@ -96,9 +97,9 @@ 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
 Freiburg 2007 ([Paper available here](erlang07-wiger.pdf)).
 

+ 89 - 306
doc/gproc.md

@@ -6,40 +6,32 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
 Extended process registry
 This module implements an extended process registry.
+
 __Behaviours:__ [`gen_server`](gen_server.md).
 
 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
+
 <a name="description"></a>
 
 ## Description ##
 
-
-
 For a detailed description, see
 [erlang07-wiger.pdf](erlang07-wiger.pdf).
 
-
-
 __NOTE:__ The functions in the Gproc API expect the Gproc application
 to be running.
 
 
-
-
 ## Tuning Gproc performance ##
 
-
-
 Gproc relies on a central server and an ordered-set ets table.
 Effort is made to perform as much work as possible in the client without
 sacrificing consistency. A few things can be tuned by setting the following
 application environment variables in the top application of `gproc`
 (usually `gproc`):
 
-
 * `{ets_options, list()}` - Currently, the options `{write_concurrency, F}`
 and `{read_concurrency, F}` are allowed. The default is
 `[{write_concurrency, true}, {read_concurrency, true}]`
@@ -58,7 +50,6 @@ will improve performance.
 ### <a name="type-context">context()</a> ###
 
 
-
 <pre><code>
 context() = {<a href="#type-scope">scope()</a>, <a href="#type-type">type()</a>} | <a href="#type-type">type()</a>
 </code></pre>
@@ -66,11 +57,9 @@ context() = {<a href="#type-scope">scope()</a>, <a href="#type-type">type()</a>}
 
 
 
-
 ### <a name="type-ctr_incr">ctr_incr()</a> ###
 
 
-
 <pre><code>
 ctr_incr() = integer()
 </code></pre>
@@ -78,11 +67,9 @@ ctr_incr() = integer()
 
 
 
-
 ### <a name="type-ctr_setval">ctr_setval()</a> ###
 
 
-
 <pre><code>
 ctr_setval() = integer()
 </code></pre>
@@ -90,11 +77,9 @@ ctr_setval() = integer()
 
 
 
-
 ### <a name="type-ctr_thr">ctr_thr()</a> ###
 
 
-
 <pre><code>
 ctr_thr() = integer()
 </code></pre>
@@ -102,11 +87,9 @@ ctr_thr() = integer()
 
 
 
-
 ### <a name="type-ctr_update">ctr_update()</a> ###
 
 
-
 <pre><code>
 ctr_update() = <a href="#type-ctr_incr">ctr_incr()</a> | {<a href="#type-ctr_incr">ctr_incr()</a>, <a href="#type-ctr_thr">ctr_thr()</a>, <a href="#type-ctr_setval">ctr_setval()</a>}
 </code></pre>
@@ -114,11 +97,9 @@ ctr_update() = <a href="#type-ctr_incr">ctr_incr()</a> | {<a href="#type-ctr_inc
 
 
 
-
 ### <a name="type-headpat">headpat()</a> ###
 
 
-
 <pre><code>
 headpat() = {<a href="#type-keypat">keypat()</a>, <a href="#type-pidpat">pidpat()</a>, any()}
 </code></pre>
@@ -126,11 +107,9 @@ headpat() = {<a href="#type-keypat">keypat()</a>, <a href="#type-pidpat">pidpat(
 
 
 
-
 ### <a name="type-increment">increment()</a> ###
 
 
-
 <pre><code>
 increment() = <a href="#type-ctr_incr">ctr_incr()</a> | <a href="#type-ctr_update">ctr_update()</a> | [<a href="#type-ctr_update">ctr_update()</a>]
 </code></pre>
@@ -138,11 +117,9 @@ increment() = <a href="#type-ctr_incr">ctr_incr()</a> | <a href="#type-ctr_updat
 
 
 
-
 ### <a name="type-key">key()</a> ###
 
 
-
 <pre><code>
 key() = {<a href="#type-type">type()</a>, <a href="#type-scope">scope()</a>, any()}
 </code></pre>
@@ -150,11 +127,9 @@ key() = {<a href="#type-type">type()</a>, <a href="#type-scope">scope()</a>, any
 
 
 
-
 ### <a name="type-keypat">keypat()</a> ###
 
 
-
 <pre><code>
 keypat() = {<a href="#type-sel_type">sel_type()</a> | <a href="#type-sel_var">sel_var()</a>, l | g | <a href="#type-sel_var">sel_var()</a>, any()}
 </code></pre>
@@ -162,11 +137,9 @@ keypat() = {<a href="#type-sel_type">sel_type()</a> | <a href="#type-sel_var">se
 
 
 
-
 ### <a name="type-monitor_type">monitor_type()</a> ###
 
 
-
 <pre><code>
 monitor_type() = info | standby | follow
 </code></pre>
@@ -174,11 +147,9 @@ monitor_type() = info | standby | follow
 
 
 
-
 ### <a name="type-pidpat">pidpat()</a> ###
 
 
-
 <pre><code>
 pidpat() = pid() | <a href="#type-sel_var">sel_var()</a>
 </code></pre>
@@ -186,11 +157,9 @@ pidpat() = pid() | <a href="#type-sel_var">sel_var()</a>
 
 
 
-
 ### <a name="type-reg_id">reg_id()</a> ###
 
 
-
 <pre><code>
 reg_id() = {<a href="#type-type">type()</a>, <a href="#type-scope">scope()</a>, any()}
 </code></pre>
@@ -198,11 +167,9 @@ reg_id() = {<a href="#type-type">type()</a>, <a href="#type-scope">scope()</a>,
 
 
 
-
 ### <a name="type-scope">scope()</a> ###
 
 
-
 <pre><code>
 scope() = l | g
 </code></pre>
@@ -210,11 +177,9 @@ scope() = l | g
 
 
 
-
 ### <a name="type-sel_context">sel_context()</a> ###
 
 
-
 <pre><code>
 sel_context() = {<a href="#type-scope">scope()</a>, <a href="#type-type">type()</a>} | <a href="#type-type">type()</a>
 </code></pre>
@@ -222,11 +187,9 @@ sel_context() = {<a href="#type-scope">scope()</a>, <a href="#type-type">type()<
 
 
 
-
 ### <a name="type-sel_pattern">sel_pattern()</a> ###
 
 
-
 <pre><code>
 sel_pattern() = [{<a href="#type-headpat">headpat()</a>, list(), list()}]
 </code></pre>
@@ -234,11 +197,9 @@ sel_pattern() = [{<a href="#type-headpat">headpat()</a>, list(), list()}]
 
 
 
-
 ### <a name="type-sel_scope">sel_scope()</a> ###
 
 
-
 <pre><code>
 sel_scope() = scope | all | global | local
 </code></pre>
@@ -246,11 +207,9 @@ sel_scope() = scope | all | global | local
 
 
 
-
 ### <a name="type-sel_type">sel_type()</a> ###
 
 
-
 <pre><code>
 sel_type() = <a href="#type-type">type()</a> | names | props | counters | aggr_counters | resources | resource_counters
 </code></pre>
@@ -258,11 +217,9 @@ sel_type() = <a href="#type-type">type()</a> | names | props | counters | aggr_c
 
 
 
-
 ### <a name="type-sel_var">sel_var()</a> ###
 
 
-
 <pre><code>
 sel_var() = '_' | atom()
 </code></pre>
@@ -270,11 +227,9 @@ sel_var() = '_' | atom()
 
 
 
-
 ### <a name="type-type">type()</a> ###
 
 
-
 <pre><code>
 type() = n | p | c | a | r | rc
 </code></pre>
@@ -282,16 +237,13 @@ type() = n | p | c | a | r | rc
 
 
 
-
 ### <a name="type-unique_id">unique_id()</a> ###
 
 
-
 <pre><code>
 unique_id() = {n | a, <a href="#type-scope">scope()</a>, any()}
 </code></pre>
 
-
 <a name="index"></a>
 
 ## Function Index ##
@@ -319,6 +271,7 @@ a unique name registered via gproc.</td></tr><tr><td valign="top"><a href="#mreg
 Equivalent to [`reg({a, g, Name})`](#reg-1).
 
 Registers a global (unique) aggregated counter.
+
 <a name="add_global_counter-2"></a>
 
 ### add_global_counter/2 ###
@@ -326,6 +279,7 @@ Registers a global (unique) aggregated counter.
 `add_global_counter(Name, Initial) -> any()`
 
 Registers a global (non-unique) counter. @equiv reg({c,g,Name},Value)
+
 <a name="add_global_name-1"></a>
 
 ### add_global_name/1 ###
@@ -333,6 +287,7 @@ Registers a global (non-unique) counter. @equiv reg({c,g,Name},Value)
 `add_global_name(Name) -> any()`
 
 Registers a global (unique) name. @equiv reg({n,g,Name})
+
 <a name="add_global_property-2"></a>
 
 ### add_global_property/2 ###
@@ -340,6 +295,7 @@ Registers a global (unique) name. @equiv reg({n,g,Name})
 `add_global_property(Name, Value) -> any()`
 
 Registers a global (non-unique) property. @equiv reg({p,g,Name},Value)
+
 <a name="add_local_aggr_counter-1"></a>
 
 ### add_local_aggr_counter/1 ###
@@ -349,6 +305,7 @@ Registers a global (non-unique) property. @equiv reg({p,g,Name},Value)
 Equivalent to [`reg({a, l, Name})`](#reg-1).
 
 Registers a local (unique) aggregated counter.
+
 <a name="add_local_counter-2"></a>
 
 ### add_local_counter/2 ###
@@ -356,6 +313,7 @@ Registers a local (unique) aggregated counter.
 `add_local_counter(Name, Initial) -> any()`
 
 Registers a local (non-unique) counter. @equiv reg({c,l,Name},Value)
+
 <a name="add_local_name-1"></a>
 
 ### add_local_name/1 ###
@@ -363,6 +321,7 @@ Registers a local (non-unique) counter. @equiv reg({c,l,Name},Value)
 `add_local_name(Name) -> any()`
 
 Registers a local (unique) name. @equiv reg({n,l,Name})
+
 <a name="add_local_property-2"></a>
 
 ### add_local_property/2 ###
@@ -370,6 +329,7 @@ Registers a local (unique) name. @equiv reg({n,l,Name})
 `add_local_property(Name, Value) -> any()`
 
 Registers a local (non-unique) property. @equiv reg({p,l,Name},Value)
+
 <a name="add_shared_local_counter-2"></a>
 
 ### add_shared_local_counter/2 ###
@@ -379,33 +339,31 @@ Registers a local (non-unique) property. @equiv reg({p,l,Name},Value)
 Equivalent to [`reg_shared({c, l, Name}, Value)`](#reg_shared-2).
 
 Registers a local shared (unique) counter.
+
 <a name="audit_process-1"></a>
 
 ### audit_process/1 ###
 
-
 <pre><code>
 audit_process(Pid::pid()) -&gt; ok
 </code></pre>
 <br />
 
-
 <a name="await-1"></a>
 
 ### await/1 ###
 
-
 <pre><code>
 await(Key::<a href="#type-key">key()</a>) -&gt; {pid(), Value}
 </code></pre>
 <br />
 
 Equivalent to [`await(Key, infinity)`](#await-2).
+
 <a name="await-2"></a>
 
 ### await/2 ###
 
-
 <pre><code>
 await(Key::<a href="#type-key">key()</a>, Timeout) -&gt; {pid(), Value}
 </code></pre>
@@ -419,11 +377,11 @@ A small optimization: we first perform a lookup, to see if the name
 is already registered. This way, the cost of the operation will be
 roughly the same as of where/1 in the case where the name is already
 registered (the difference: await/2 also returns the value).
+
 <a name="await-3"></a>
 
 ### await/3 ###
 
-
 <pre><code>
 await(Node::node(), Key::<a href="#type-key">key()</a>, Timeout) -&gt; {pid(), Value}
 </code></pre>
@@ -435,31 +393,29 @@ This function works exactly like [`await/2`](#await-2), but queries a remote
 node instead. An exception is thrown if `Node` cannot be reached. If gproc
 is not running on a given node, this is treated the same as the node being
 down.
+
 <a name="bcast-2"></a>
 
 ### bcast/2 ###
 
-
 <pre><code>
 bcast(Key::<a href="#type-key">key()</a>, Msg::any()) -&gt; Msg
 </code></pre>
 <br />
 
 Equivalent to [`bcast(nodes(), Key, Msg)`](#bcast-3).
+
 <a name="bcast-3"></a>
 
 ### bcast/3 ###
 
-
 <pre><code>
 bcast(Nodes::[atom()], Key::<a href="#type-key">key()</a>, Msg::any()) -&gt; Msg
 </code></pre>
 <br />
 
-
 Sends a message to processes corresponding to Key on Nodes.
 
-
 This function complements `send/2` and works on locally registered resources
 that `send/2` supports. Messages are routed via a special broadcast server
 on each node to ensure that ordering is preserved. Distributed delivery
@@ -467,59 +423,53 @@ is asynchronous and carries the same guarantees as normal message passing
 (with the added proviso that the broadcast server also needs to be available).
 
 __See also:__ [send/2](#send-2).
+
 <a name="cancel_wait-2"></a>
 
 ### cancel_wait/2 ###
 
-
 <pre><code>
 cancel_wait(Key::<a href="#type-key">key()</a>, Ref) -&gt; ok
 </code></pre>
 
 <ul class="definitions"><li><code>Ref = all | reference()</code></li></ul>
 
-
 Cancels a previous call to nb_wait/1
 
-
 If `Ref = all`, all wait requests on `Key` from the calling process
 are canceled.
+
 <a name="cancel_wait-3"></a>
 
 ### cancel_wait/3 ###
 
-
 <pre><code>
 cancel_wait(Node::node(), Key::<a href="#type-key">key()</a>, Ref) -&gt; ok
 </code></pre>
 
 <ul class="definitions"><li><code>Ref = all | reference()</code></li></ul>
 
-
 Cancels a previous call to nb_wait/2
 
-
 This function works just like [`cancel_wait/2`](#cancel_wait-2), but talks to a remote
 node.
+
 <a name="cancel_wait_or_monitor-1"></a>
 
 ### cancel_wait_or_monitor/1 ###
 
 `cancel_wait_or_monitor(Key) -> any()`
 
-
 <a name="default-1"></a>
 
 ### default/1 ###
 
 `default(X1) -> any()`
 
-
 <a name="demonitor-2"></a>
 
 ### demonitor/2 ###
 
-
 <pre><code>
 demonitor(Key::<a href="#type-key">key()</a>, Ref::reference()) -&gt; ok
 </code></pre>
@@ -528,76 +478,68 @@ demonitor(Key::<a href="#type-key">key()</a>, Ref::reference()) -&gt; ok
 Remove a monitor on a registered name
 This function is the reverse of monitor/1. It removes a monitor previously
 set on a unique name. This function always succeeds given legal input.
+
 <a name="first-1"></a>
 
 ### first/1 ###
 
-
 <pre><code>
 first(Context::<a href="#type-context">context()</a>) -&gt; <a href="#type-key">key()</a> | '$end_of_table'
 </code></pre>
 <br />
 
-
 Behaves as ets:first(Tab) for a given type of registration.
 
-
 See [`http://www.erlang.org/doc/man/ets.html#first-1`](http://www.erlang.org/doc/man/ets.html#first-1).
 The registry behaves as an ordered_set table.
+
 <a name="get_attribute-2"></a>
 
 ### get_attribute/2 ###
 
-
 <pre><code>
 get_attribute(Key, Attribute::atom()) -&gt; Value
 </code></pre>
 <br />
 
-
 Get attribute value of `Attr` associated with `Key` for most likely Pid.
 
-
 The most likely Pid in this case is `self()` for properties and counters,
 and the current registration holder in case of names or aggregated counters.
 An exception is raised if `Key` is not registered for the given process.
+
 <a name="get_attribute-3"></a>
 
 ### get_attribute/3 ###
 
-
 <pre><code>
 get_attribute(Key, Pid::pid() | shared, Attr::atom()) -&gt; Value
 </code></pre>
 <br />
 
-
 Get the attribute value of `Attr` associated with `Key` for process Pid.
 
-
 If `Pid == shared`, the attribute of a shared key (see [`reg_shared/1`](#reg_shared-1))
 will be read.
+
 <a name="get_attribute_shared-2"></a>
 
 ### get_attribute_shared/2 ###
 
-
 <pre><code>
 get_attribute_shared(Key, Attr::atom()) -&gt; Value
 </code></pre>
 <br />
 
-
 Get the attribute value of `Attr` associated with the shared `Key`.
 
-
 Equivalent to `get_attribute(Key, shared, Attr)`
 (see [`get_attribute/3`](#get_attribute-3)).
+
 <a name="get_attributes-1"></a>
 
 ### get_attributes/1 ###
 
-
 <pre><code>
 get_attributes(Key::<a href="#type-key">key()</a>) -&gt; [{K, V}]
 </code></pre>
@@ -606,20 +548,18 @@ get_attributes(Key::<a href="#type-key">key()</a>) -&gt; [{K, V}]
 Equivalent to [`get_attributes(Key, self())`](#get_attributes-2).
 
 Get attributes associated with registration.
+
 <a name="get_attributes-2"></a>
 
 ### get_attributes/2 ###
 
-
 <pre><code>
 get_attributes(Key::<a href="#type-key">key()</a>, Pid::pid() | shared) -&gt; [{K, V}]
 </code></pre>
 <br />
 
-
 Returns the list of attributes associated with the registration.
 
-
 This function raises a `badarg` exception if there is no corresponding
 registration.
 
@@ -627,36 +567,30 @@ registration.
 
 ### get_env/3 ###
 
-
 <pre><code>
 get_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom()) -&gt; term()
 </code></pre>
 <br />
 
 Equivalent to [`get_env(Scope, App, Key, [app_env])`](#get_env-4).
+
 <a name="get_env-4"></a>
 
 ### get_env/4 ###
 
-
 <pre><code>
 get_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Strategy) -&gt; term()
 </code></pre>
 
 <ul class="definitions"><li><code>Strategy = [Alternative]</code></li><li><code>Alternative = app_env | os_env | inherit | {inherit, pid()} | {inherit, <a href="#type-unique_id">unique_id()</a>} | init_arg | {mnesia, ActivityType, Oid, Pos} | {default, term()} | error</code></li></ul>
 
-
 Read an environment value, potentially cached as a `gproc_env` property.
 
-
-
 This function first tries to read the value of a cached property,
 `{p, Scope, {gproc_env, App, Key}}`. If this fails, it will try the provided
 alternative strategy. `Strategy` is a list of alternatives, tried in order.
 Each alternative can be one of:
 
-
-
 * `app_env` - try `application:get_env(App, Key)`
 * `os_env` - try `os:getenv(ENV)`, where `ENV` is `Key` converted into an
 uppercase string
@@ -673,159 +607,133 @@ the value in position `Pos` if object found.
 been exhausted; if not set, `undefined` will be returned.
 * `error` - raise an exception, `erlang:error(gproc_env, [App, Key, Scope])`.
 
-
-
 While any alternative can occur more than once, the only one that might make
 sense to use multiple times is `{default, Value}`.
 
-
-
 The return value will be one of:
 
-
-
 * The value of the first matching alternative, or `error` eception,
 whichever comes first
 * The last instance of `{default, Value}`, or `undefined`, if there is no
 matching alternative, default or `error` entry in the list.
 
-
 The `error` option can be used to assert that a value has been previously
 cached. Alternatively, it can be used to assert that a value is either cached
 or at least defined somewhere,
 e.g. `get_env(l, mnesia, dir, [app_env, error])`.
+
 <a name="get_set_env-3"></a>
 
 ### get_set_env/3 ###
 
-
 <pre><code>
 get_set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom()) -&gt; term()
 </code></pre>
 <br />
 
 Equivalent to [`get_set_env(Scope, App, Key, [app_env])`](#get_set_env-4).
+
 <a name="get_set_env-4"></a>
 
 ### get_set_env/4 ###
 
-
 <pre><code>
 get_set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Strategy) -&gt; Value
 </code></pre>
 <br />
 
-
 Fetch and cache an environment value, if not already cached.
 
-
 This function does the same thing as [`get_env/4`](#get_env-4), but also updates the
 cache. Note that the cache will be updated even if the result of the lookup
 is `undefined`.
 
-
 __See also:__ [get_env/4](#get_env-4).
+
 <a name="get_value-1"></a>
 
 ### get_value/1 ###
 
-
 <pre><code>
 get_value(Key) -&gt; Value
 </code></pre>
 <br />
 
-
 Reads the value stored with a key registered to the current process.
 
-
 If no such key is registered to the current process, this function exits.
+
 <a name="get_value-2"></a>
 
 ### get_value/2 ###
 
-
 <pre><code>
 get_value(Key, Pid) -&gt; Value
 </code></pre>
 <br />
 
-
 Reads the value stored with a key registered to the process Pid.
 
-
 If `Pid == shared`, the value of a shared key (see [`reg_shared/1`](#reg_shared-1))
 will be read.
+
 <a name="get_value_shared-1"></a>
 
 ### get_value_shared/1 ###
 
-
 <pre><code>
 get_value_shared(Key) -&gt; Value
 </code></pre>
 <br />
 
-
 Reads the value stored with a shared key.
 
-
 If no such shared key is registered, this function exits.
+
 <a name="give_away-2"></a>
 
 ### give_away/2 ###
 
-
 <pre><code>
 give_away(From::<a href="#type-key">key()</a>, To::pid() | <a href="#type-key">key()</a>) -&gt; undefined | pid()
 </code></pre>
 <br />
 
-
 Atomically transfers the key `From` to the process identified by `To`.
 
-
-
 This function transfers any gproc key (name, property, counter, aggr counter)
 from one process to another, and returns the pid of the new owner.
 
-
-
 `To` must be either a pid or a unique name (name or aggregated counter), but
 does not necessarily have to resolve to an existing process. If there is
 no process registered with the `To` key, `give_away/2` returns `undefined`,
 and the `From` key is effectively unregistered.
 
-
-
 It is allowed to give away a key to oneself, but of course, this operation
 will have no effect.
 
-
 Fails with `badarg` if the calling process does not have a `From` key
 registered.
+
 <a name="goodbye-0"></a>
 
 ### goodbye/0 ###
 
-
 <pre><code>
 goodbye() -&gt; ok
 </code></pre>
 <br />
 
-
 Unregister all items of the calling process and inform gproc
 to forget about the calling process.
 
-
 This function is more efficient than letting gproc perform these
 cleanup operations.
+
 <a name="i-0"></a>
 
 ### i/0 ###
 
-
 <pre><code>
 i() -&gt; ok
 </code></pre>
@@ -833,62 +741,56 @@ i() -&gt; ok
 
 Similar to the built-in shell command `i()` but inserts information
 about names and properties registered in Gproc, where applicable.
+
 <a name="info-1"></a>
 
 ### info/1 ###
 
-
 <pre><code>
 info(Pid::pid()) -&gt; ProcessInfo
 </code></pre>
 
 <ul class="definitions"><li><code>ProcessInfo = [{gproc, [{Key, Value}]} | ProcessInfo]</code></li></ul>
 
-
 Similar to `process_info(Pid)` but with additional gproc info.
 
-
 Returns the same information as process_info(Pid), but with the
 addition of a `gproc` information item, containing the `{Key,Value}`
 pairs registered to the process.
+
 <a name="info-2"></a>
 
 ### info/2 ###
 
-
 <pre><code>
 info(Pid::pid(), Item::atom()) -&gt; {Item, Info}
 </code></pre>
 <br />
 
-
 Similar to process_info(Pid, Item), but with additional gproc info.
 
-
 For `Item = gproc`, this function returns a list of `{Key, Value}` pairs
 registered to the process Pid. For other values of Item, it returns the
 same as [`http://www.erlang.org/doc/man/erlang.html#process_info-2`](http://www.erlang.org/doc/man/erlang.html#process_info-2).
+
 <a name="last-1"></a>
 
 ### last/1 ###
 
-
 <pre><code>
 last(Context::<a href="#type-context">context()</a>) -&gt; <a href="#type-key">key()</a> | '$end_of_table'
 </code></pre>
 <br />
 
-
 Behaves as ets:last(Tab) for a given type of registration.
 
-
 See [`http://www.erlang.org/doc/man/ets.html#last-1`](http://www.erlang.org/doc/man/ets.html#last-1).
 The registry behaves as an ordered_set table.
+
 <a name="lookup_global_aggr_counter-1"></a>
 
 ### lookup_global_aggr_counter/1 ###
 
-
 <pre><code>
 lookup_global_aggr_counter(Name::any()) -&gt; integer()
 </code></pre>
@@ -898,11 +800,11 @@ Equivalent to [`lookup_value({a, g, Name})`](#lookup_value-1).
 
 Lookup a global (unique) aggregated counter and returns its value.
 Fails if there is no such object.
+
 <a name="lookup_global_counters-1"></a>
 
 ### lookup_global_counters/1 ###
 
-
 <pre><code>
 lookup_global_counters(Counter::any()) -&gt; [{pid(), Value::integer()}]
 </code></pre>
@@ -912,11 +814,11 @@ Equivalent to [`lookup_values({c, g, Counter})`](#lookup_values-1).
 
 Look up all global (non-unique) instances of a given Counter.
 Returns a list of {Pid, Value} tuples for all matching objects.
+
 <a name="lookup_global_name-1"></a>
 
 ### lookup_global_name/1 ###
 
-
 <pre><code>
 lookup_global_name(Name::any()) -&gt; pid()
 </code></pre>
@@ -925,11 +827,11 @@ lookup_global_name(Name::any()) -&gt; pid()
 Equivalent to [`where({n, g, Name})`](#where-1).
 
 Lookup a global unique name. Fails if there is no such name.
+
 <a name="lookup_global_properties-1"></a>
 
 ### lookup_global_properties/1 ###
 
-
 <pre><code>
 lookup_global_properties(Property::any()) -&gt; [{pid(), Value}]
 </code></pre>
@@ -939,11 +841,11 @@ Equivalent to [`lookup_values({p, g, Property})`](#lookup_values-1).
 
 Look up all global (non-unique) instances of a given Property.
 Returns a list of {Pid, Value} tuples for all matching objects.
+
 <a name="lookup_local_aggr_counter-1"></a>
 
 ### lookup_local_aggr_counter/1 ###
 
-
 <pre><code>
 lookup_local_aggr_counter(Name::any()) -&gt; integer()
 </code></pre>
@@ -953,11 +855,11 @@ Equivalent to [`where({a, l, Name})`](#where-1).
 
 Lookup a local (unique) aggregated counter and returns its value.
 Fails if there is no such object.
+
 <a name="lookup_local_counters-1"></a>
 
 ### lookup_local_counters/1 ###
 
-
 <pre><code>
 lookup_local_counters(Counter::any()) -&gt; [{pid(), Value::integer()}]
 </code></pre>
@@ -967,11 +869,11 @@ Equivalent to [`lookup_values({c, l, Counter})`](#lookup_values-1).
 
 Look up all local (non-unique) instances of a given Counter.
 Returns a list of {Pid, Value} tuples for all matching objects.
+
 <a name="lookup_local_name-1"></a>
 
 ### lookup_local_name/1 ###
 
-
 <pre><code>
 lookup_local_name(Name::any()) -&gt; pid()
 </code></pre>
@@ -980,11 +882,11 @@ lookup_local_name(Name::any()) -&gt; pid()
 Equivalent to [`where({n, l, Name})`](#where-1).
 
 Lookup a local unique name. Fails if there is no such name.
+
 <a name="lookup_local_properties-1"></a>
 
 ### lookup_local_properties/1 ###
 
-
 <pre><code>
 lookup_local_properties(Property::any()) -&gt; [{pid(), Value}]
 </code></pre>
@@ -994,75 +896,66 @@ Equivalent to [`lookup_values({p, l, Property})`](#lookup_values-1).
 
 Look up all local (non-unique) instances of a given Property.
 Returns a list of {Pid, Value} tuples for all matching objects.
+
 <a name="lookup_pid-1"></a>
 
 ### lookup_pid/1 ###
 
-
 <pre><code>
 lookup_pid(Key) -&gt; Pid
 </code></pre>
 <br />
 
-
 Lookup the Pid stored with a key.
 
-
 This function raises a `badarg` exception if `Key` is not registered.
+
 <a name="lookup_pids-1"></a>
 
 ### lookup_pids/1 ###
 
-
 <pre><code>
 lookup_pids(Key::<a href="#type-key">key()</a>) -&gt; [pid()]
 </code></pre>
 <br />
 
-
 Returns a list of pids with the published key Key
 
-
-
 If the type of registration is either name or aggregated counter,
 this function will return either an empty list, or a list of one pid.
 For non-unique types, the return value can be a list of any length.
 
-
 Note: shared resources are not associated with any pid, and will
 therefore be excluded.
+
 <a name="lookup_value-1"></a>
 
 ### lookup_value/1 ###
 
-
 <pre><code>
 lookup_value(Key) -&gt; Value
 </code></pre>
 <br />
 
-
 Lookup the value stored with a key.
 
-
 This function raises a `badarg` exception if `Key` is not registered.
+
 <a name="lookup_values-1"></a>
 
 ### lookup_values/1 ###
 
-
 <pre><code>
 lookup_values(Key::<a href="#type-key">key()</a>) -&gt; [{pid(), Value}]
 </code></pre>
 <br />
 
-
 Retrieve the `{Pid,Value}` pairs corresponding to Key.
 
-
 Key refer to any type of registry object. If it refers to a unique
 object, the list will be of length 0 or 1. If it refers to a non-unique
 object, the return value can be a list of any length.
+
 <a name="monitor-1"></a>
 
 ### monitor/1 ###
@@ -1070,17 +963,16 @@ object, the return value can be a list of any length.
 `monitor(Key) -> any()`
 
 Equivalent to [`monitor(Key, info)`](#monitor-2).
+
 <a name="monitor-2"></a>
 
 ### monitor/2 ###
 
-
 <pre><code>
 monitor(Key::<a href="#type-key">key()</a>, Type::<a href="#type-monitor_type">monitor_type()</a>) -&gt; reference()
 </code></pre>
 <br />
 
-
 monitor a registered name
 `monitor(Key, info)` works much like erlang:monitor(process, Pid), but monitors
 a unique name registered via gproc. A message, `{gproc, unreg, Ref, Key}`
@@ -1090,62 +982,53 @@ message `{gproc, {failover, ToPid}, Ref, Key}` is sent to all monitors.
 If the name is passed to another process using [`give_away/2`](#give_away-2), the event
 `{gproc, {migrated, ToPid}, Ref, Key}` is sent to all monitors.
 
-
-
 `monitor(Key, standby)` sets up the monitoring process as a standby for the
 registered name. If the registered process dies, the first standby process
 inherits the name, and a message `{gproc, {failover, ToPid}, Ref, Key}` is
 sent to all monitors, including the one that inherited the name.
 
-
-
 If the name is not yet registered, the unreg event is sent immediately.
 If the calling process in this case tried to start a `standby` monitoring,
 it receives the registered name and the failover event immediately.
 
-
 `monitor(Key, follow)` keeps monitoring the registered name even if it is
 temporarily unregistered. The messages received are the same as for the other
 monitor types, but `{gproc, registered, Ref, Key}` is also sent when a new
 process registers the name.
+
 <a name="mreg-3"></a>
 
 ### mreg/3 ###
 
-
 <pre><code>
 mreg(T::<a href="#type-type">type()</a>, C::<a href="#type-scope">scope()</a>, KVL::[{Key::any(), Value::any()}]) -&gt; true
 </code></pre>
 <br />
 
-
 Register multiple {Key,Value} pairs of a given type and scope.
 
-
 This function is more efficient than calling [`reg/2`](#reg-2) repeatedly.
 It is also atomic in regard to unique names; either all names are registered
 or none are.
+
 <a name="munreg-3"></a>
 
 ### munreg/3 ###
 
-
 <pre><code>
 munreg(T::<a href="#type-type">type()</a>, C::<a href="#type-scope">scope()</a>, L::[Key::any()]) -&gt; true
 </code></pre>
 <br />
 
-
 Unregister multiple Key items of a given type and scope.
 
-
 This function is usually more efficient than calling [`unreg/1`](#unreg-1)
 repeatedly.
+
 <a name="nb_wait-1"></a>
 
 ### nb_wait/1 ###
 
-
 <pre><code>
 nb_wait(Key::<a href="#type-key">key()</a>) -&gt; Ref
 </code></pre>
@@ -1154,11 +1037,11 @@ nb_wait(Key::<a href="#type-key">key()</a>) -&gt; Ref
 Wait for a name or aggregated counter to be registered.
 The caller can expect to receive a message,
 {gproc, Ref, registered, {Key, Pid, Value}}, once the name is registered.
+
 <a name="nb_wait-2"></a>
 
 ### nb_wait/2 ###
 
-
 <pre><code>
 nb_wait(Node::node(), Key::<a href="#type-key">key()</a>) -&gt; Ref
 </code></pre>
@@ -1167,93 +1050,76 @@ nb_wait(Node::node(), Key::<a href="#type-key">key()</a>) -&gt; Ref
 Wait for a name or aggregated counter to be registered on `Node`.
 The caller can expect to receive a message,
 {gproc, Ref, registered, {Key, Pid, Value}}, once the name is registered.
+
 <a name="next-2"></a>
 
 ### next/2 ###
 
-
 <pre><code>
 next(Context::<a href="#type-context">context()</a>, Key::<a href="#type-key">key()</a>) -&gt; <a href="#type-key">key()</a> | '$end_of_table'
 </code></pre>
 <br />
 
-
 Behaves as ets:next(Tab,Key) for a given type of registration.
 
-
 See [`http://www.erlang.org/doc/man/ets.html#next-2`](http://www.erlang.org/doc/man/ets.html#next-2).
 The registry behaves as an ordered_set table.
+
 <a name="prev-2"></a>
 
 ### prev/2 ###
 
-
 <pre><code>
 prev(Context::<a href="#type-context">context()</a>, Key::<a href="#type-key">key()</a>) -&gt; <a href="#type-key">key()</a> | '$end_of_table'
 </code></pre>
 <br />
 
-
 Behaves as ets:prev(Tab,Key) for a given type of registration.
 
-
 See [`http://www.erlang.org/doc/man/ets.html#prev-2`](http://www.erlang.org/doc/man/ets.html#prev-2).
 The registry behaves as an ordered_set table.
+
 <a name="reg-1"></a>
 
 ### reg/1 ###
 
-
 <pre><code>
 reg(Key::<a href="#type-key">key()</a>) -&gt; true
 </code></pre>
 <br />
 
 Equivalent to [`reg(Key, default(Key), [])`](#reg-3).
+
 <a name="reg-2"></a>
 
 ### reg/2 ###
 
-
 <pre><code>
 reg(Key::<a href="#type-key">key()</a>, Value) -&gt; true
 </code></pre>
 <br />
 
-
 Register a name or property for the current process
 
-
-
 <a name="reg-3"></a>
 
 ### reg/3 ###
 
-
 <pre><code>
 reg(Key::<a href="#type-key">key()</a>, Value, Attrs::[{atom(), any()}]) -&gt; true
 </code></pre>
 <br />
 
-
 Register a name or property for the current process
 `Attrs` (default: `[]`) can be inspected using [`get_attribute/2`](#get_attribute-2).
 
-
-
 The structure of `Key` is `{Type, Context, Name}`, where:
 
-
-
 * `Context :: l | g` - `l` means 'local' context; `g` means 'global'
 * `Type :: p | n | c | a | r | rc` specifies the type of entry
 
-
-
 The semantics of the different types:
 
-
-
 * `p` - 'property', is non-unique, i.e. different processes can each
 register a property with the same name.
 * `n` - 'name, is unique within the given context (local or global).
@@ -1268,103 +1134,87 @@ with a 'resource counter'.
 with the same name. When the resource count reaches `0`, any triggers
 specified using an `on_zero` attribute may be executed (see below).
 
-
-
 On-zero triggers:
 
-
-
 `Msg = {gproc, resource_on_zero, Context, Name, Pid}`
 
-
 * `{send, Key}` - run `gproc:send(Key, Msg)`
 * `{bcast, Key}` - run `gproc:bcast(Key, Msg)`
 * `publish` - run
 `gproc_ps:publish(Context, gproc_resource_on_zero, {Context, Name, Pid})`
 * `{unreg_shared, Type, Name}` - unregister the shared key
 `{Type, Context, Name}`
+
 <a name="reg_or_locate-1"></a>
 
 ### reg_or_locate/1 ###
 
-
 <pre><code>
 reg_or_locate(Key::<a href="#type-key">key()</a>) -&gt; {pid(), NewValue}
 </code></pre>
 <br />
 
 Equivalent to [`reg_or_locate(Key, default(Key))`](#reg_or_locate-2).
+
 <a name="reg_or_locate-2"></a>
 
 ### reg_or_locate/2 ###
 
-
 <pre><code>
 reg_or_locate(Key::<a href="#type-key">key()</a>, Value) -&gt; {pid(), NewValue}
 </code></pre>
 <br />
 
-
 Try registering a unique name, or return existing registration.
 
-
 This function tries to register the name `Key`, if available.
 If such a registration object already exists, the pid and value of
 the current registration is returned instead.
+
 <a name="reg_or_locate-3"></a>
 
 ### reg_or_locate/3 ###
 
-
 <pre><code>
 reg_or_locate(Key::<a href="#type-key">key()</a>, Value, Fun::function()) -&gt; {pid(), NewValue}
 </code></pre>
 <br />
 
-
 Spawn a process with a registered name, or return existing registration.
 
-
-
 This function checks whether a local name is registered; if not, it spawns
 a new process (with `spawn(Fun)`) and gives it the name.
 The pid and value of the resulting registration is returned.
 
-
 When a global name is registered in this fashion, the process is
 spawned on the caller's node, and the group_leader of the spawned
 process is set to the group_leader of the calling process.
+
 <a name="reg_shared-1"></a>
 
 ### reg_shared/1 ###
 
-
 <pre><code>
 reg_shared(Key::<a href="#type-key">key()</a>) -&gt; true
 </code></pre>
 <br />
 
-
 Register a resource, but don't tie it to a particular process.
 
-
 `reg_shared({c,l,C}) -> reg_shared({c,l,C}, 0).`
 `reg_shared({a,l,A}) -> reg_shared({a,l,A}, undefined).`
+
 <a name="reg_shared-2"></a>
 
 ### reg_shared/2 ###
 
-
 <pre><code>
 reg_shared(Key::<a href="#type-key">key()</a>, Value) -&gt; true
 </code></pre>
 <br />
 
-
 Register a resource, but don't tie it to a particular process.
 
-
-
 Shared resources are all unique. They remain until explicitly unregistered
 (using [`unreg_shared/1`](#unreg_shared-1)). The types of shared resources currently
 supported are `counter` and `aggregated counter`. In listings and query
@@ -1372,110 +1222,92 @@ results, shared resources appear as other similar resources, except that
 `Pid == shared`. To wit, update_counter({c,l,myCounter}, shared, 1) would
 increment the shared counter `myCounter` with 1, provided it exists.
 
-
 A shared aggregated counter will track updates in exactly the same way as
 an aggregated counter which is owned by a process.
+
 <a name="reg_shared-3"></a>
 
 ### reg_shared/3 ###
 
 `reg_shared(Key, Value, Attrs) -> any()`
 
-
 <a name="register_name-2"></a>
 
 ### register_name/2 ###
 
-
 <pre><code>
 register_name(Name::<a href="#type-key">key()</a>, Pid::pid()) -&gt; yes | no
 </code></pre>
 <br />
 
 Behaviour support callback
+
 <a name="reset_counter-1"></a>
 
 ### reset_counter/1 ###
 
-
 <pre><code>
 reset_counter(Key) -&gt; {ValueBefore, ValueAfter}
 </code></pre>
 
 <ul class="definitions"><li><code>Key = {c, Scope, Name} | {n, Scope, Name}</code></li><li><code>Scope = l | g</code></li><li><code>ValueBefore = integer()</code></li><li><code>ValueAfter = integer()</code></li></ul>
 
-
 Reads and resets a counter in a "thread-safe" way
 
-
-
 This function reads the current value of a counter and then resets it to its
 initial value. The reset operation is done using [`update_counter/2`](#update_counter-2),
 which allows for concurrent calls to [`update_counter/2`](#update_counter-2) without losing
 updates. Aggregated counters are updated accordingly.
 
-
 If `Key` refers to a unique name, the operation will depend on the value
 part of the registration being an integer(). While non-integer values are
 not permitted at all for counter objects, it is the user's responsibility to
 ensure that a name, on which `reset_counter/1` is to be performed, has the
 appropriate value type.
+
 <a name="select-1"></a>
 
 ### select/1 ###
 
-
 <pre><code>
 select(Continuation::Arg) -&gt; [Match] | {[Match], Continuation} | '$end_of_table'
 </code></pre>
 
 <ul class="definitions"><li><code>Arg = Continuation | <a href="#type-sel_pattern">sel_pattern()</a></code></li><li><code>Match = {Key, Pid, Value}</code></li></ul>
 
-
 Perform a select operation on the process registry
 
-
-
 When Arg = Contination, resume a gproc:select/1 operation
 (see [ets:select/1](http://www.erlang.org/doc/man/ets.html#select-1)
 
-
-
 When Arg = <code><a href="#type-sel_pattern">sel_pattern()</a></code>, this function executes a select operation,
 emulating ets:select/1
 
-
-
 [`select/2`](#select-2) offers the opportunity to narrow the search
 (by limiting to only global or local scope, or a single type of object).
 When only a pattern as single argument is given, both global and local scope,
 as well as all types of object can be searched. Note that the pattern may
 still limit the select operation so that scanning the entire table is avoided.
 
-
 The physical representation in the registry may differ from the above,
 but the select patterns are transformed appropriately. The logical
 representation for the gproc select operations is given by
 <code><a href="#type-headpat">headpat()</a></code>.
+
 <a name="select-2"></a>
 
 ### select/2 ###
 
-
 <pre><code>
 select(Context::<a href="#type-sel_context">sel_context()</a>, Pat::<a href="#type-sel_pattern">sel_pattern()</a>) -&gt; [{Key, Pid, Value}]
 </code></pre>
 <br />
 
-
 Perform a select operation with limited context on the process registry
 
-
-
 The physical representation in the registry may differ from the above,
 but the select patterns are transformed appropriately.
 
-
 Note that limiting the context is just a convenience function, allowing you
 to write a simpler select pattern and still avoid searching the entire
 registry. Whenever variables are used in the head pattern, this will result
@@ -1484,235 +1316,203 @@ in a wider scan, even if the values are restricted through a guard (e.g.
 will count as a wild pattern on the key and result in a full scan).
 In this case, specifying a Context will allow gproc to perform some
 variable substitution and ensure that the scan is limited.
+
 <a name="select-3"></a>
 
 ### select/3 ###
 
-
 <pre><code>
 select(Context::<a href="#type-context">context()</a>, Pat::<a href="#type-sel_patten">sel_patten()</a>, Limit::integer()) -&gt; {[Match], Continuation} | '$end_of_table'
 </code></pre>
 <br />
 
-
 Like [`select/2`](#select-2) but returns Limit objects at a time.
 
-
 See [`http://www.erlang.org/doc/man/ets.html#select-3`](http://www.erlang.org/doc/man/ets.html#select-3).
+
 <a name="select_count-1"></a>
 
 ### select_count/1 ###
 
-
 <pre><code>
 select_count(Pat::<a href="#type-sel_pattern">sel_pattern()</a>) -&gt; [<a href="#type-sel_object">sel_object()</a>]
 </code></pre>
 <br />
 
 Equivalent to [`select_count(all, Pat)`](#select_count-2).
+
 <a name="select_count-2"></a>
 
 ### select_count/2 ###
 
-
 <pre><code>
 select_count(Context::<a href="#type-context">context()</a>, Pat::<a href="#type-sel_pattern">sel_pattern()</a>) -&gt; [{Key, Pid, Value}]
 </code></pre>
 <br />
 
-
 Perform a select_count operation on the process registry.
 
-
 The physical representation in the registry may differ from the above,
 but the select patterns are transformed appropriately.
+
 <a name="send-2"></a>
 
 ### send/2 ###
 
-
 <pre><code>
 send(Key::<a href="#type-process">process()</a> | <a href="#type-key">key()</a>, Msg::any()) -&gt; Msg
 </code></pre>
 <br />
 
-
 Sends a message to the process, or processes, corresponding to Key.
 
-
-
 If Key belongs to a unique object (name or aggregated counter), this
 function will send a message to the corresponding process, or fail if there
 is no such process. If Key is for a non-unique object type (counter or
 property), Msg will be send to all processes that have such an object.
 
-
 Key can also be anything that the erlang:send/2, or '!' operator accepts as a process
 identifier, namely a pid(), an atom(), or `{Name::atom(), Node::atom()}`.
+
 <a name="set_attributes-2"></a>
 
 ### set_attributes/2 ###
 
-
 <pre><code>
 set_attributes(Key::<a href="#type-key">key()</a>, Props::[{atom(), any()}]) -&gt; true
 </code></pre>
 <br />
 
-
 Add/modify `{Key, Value}` attributes associated with a registration.
 
-
-
 Gproc registration objects can have `{Key, Value}` attributes associated with
 them. These are stored in a way that doesn't affect the cost of name lookup.
 
-
 Attributs can be retrieved using `gproc:get_attribute/3` or
 `gproc:get_attributes/2`.
+
 <a name="set_attributes_shared-2"></a>
 
 ### set_attributes_shared/2 ###
 
-
 <pre><code>
 set_attributes_shared(Key::<a href="#type-key">key()</a>, Props::[{K, V}]) -&gt; true
 </code></pre>
 <br />
 
-
 Add/modify `{Key, Value}` attributes associated with a shared registration.
 
-
-
 Gproc registration objects can have `{Key, Value}` attributes associated with
 them. These are stored in a way that doesn't affect the cost of name lookup.
 
-
 Attributes can be retrieved using `gproc:get_attribute/3` or
 `gproc:get_attributes/2`.
+
 <a name="set_env-5"></a>
 
 ### set_env/5 ###
 
-
 <pre><code>
 set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Value::term(), Strategy) -&gt; Value
 </code></pre>
 
 <ul class="definitions"><li><code>Strategy = [Alternative]</code></li><li><code>Alternative = app_env | os_env | {os_env, VAR} | {mnesia, ActivityType, Oid, Pos}</code></li></ul>
 
-
 Updates the cached value as well as underlying environment.
 
-
-
 This function should be exercised with caution, as it affects the larger
 environment outside gproc. This function modifies the cached value, and then
 proceeds to update the underlying environment (OS environment variable or
 application environment variable).
 
-
 When the `mnesia` alternative is used, gproc will try to update any existing
 object, changing only the `Pos` position. If no such object exists, it will
 create a new object, setting any other attributes (except `Pos` and the key)
 to `undefined`.
+
 <a name="set_value-2"></a>
 
 ### set_value/2 ###
 
-
 <pre><code>
 set_value(Key::<a href="#type-key">key()</a>, Value) -&gt; true
 </code></pre>
 <br />
 
-
 Sets the value of the registration given by Key
 
-
-
 Key is assumed to exist and belong to the calling process.
 If it doesn't, this function will exit.
 
-
 Value can be any term, unless the object is a counter, in which case
 it must be an integer.
+
 <a name="set_value_shared-2"></a>
 
 ### set_value_shared/2 ###
 
-
 <pre><code>
 set_value_shared(Key::<a href="#type-key">key()</a>, Value) -&gt; true
 </code></pre>
 <br />
 
-
 Sets the value of the shared registration given by Key
 
-
-
 Key is assumed to exist as a shared entity.
 If it doesn't, this function will exit.
 
-
 Value can be any term, unless the object is a counter, in which case
 it must be an integer.
+
 <a name="start_link-0"></a>
 
 ### start_link/0 ###
 
-
 <pre><code>
 start_link() -&gt; {ok, pid()}
 </code></pre>
 <br />
 
-
 Starts the gproc server.
 
-
 This function is intended to be called from gproc_sup, as part of
 starting the gproc application.
+
 <a name="table-0"></a>
 
 ### table/0 ###
 
-
 <pre><code>
 table() -&gt; any()
 </code></pre>
 <br />
 
 Equivalent to [`table({all, all})`](#table-1).
+
 <a name="table-1"></a>
 
 ### table/1 ###
 
-
 <pre><code>
 table(Context::<a href="#type-context">context()</a>) -&gt; any()
 </code></pre>
 <br />
 
 Equivalent to [`table(Context, [])`](#table-2).
+
 <a name="table-2"></a>
 
 ### table/2 ###
 
-
 <pre><code>
 table(Context::<a href="#type-context">context()</a>, Opts) -&gt; any()
 </code></pre>
 <br />
 
-
 QLC table generator for the gproc registry.
 Context specifies which subset of the registry should be queried.
 See [`http://www.erlang.org/doc/man/qlc.html`](http://www.erlang.org/doc/man/qlc.html).
 
-
 NOTE: By default, the gproc table generator will not filter out entries
 belonging to processes that have just died, but which have yet to be cleared
 out of the registry. Use the option `check_pids` (or `{check_pids, true}`)
@@ -1725,24 +1525,24 @@ entries in the list by the time your program processes it.
 
 ### unreg/1 ###
 
-
 <pre><code>
 unreg(Key::<a href="#type-key">key()</a>) -&gt; true
 </code></pre>
 <br />
 
 Unregister a name or property.
+
 <a name="unreg_shared-1"></a>
 
 ### unreg_shared/1 ###
 
-
 <pre><code>
 unreg_shared(Key::<a href="#type-key">key()</a>) -&gt; true
 </code></pre>
 <br />
 
 Unregister a shared resource.
+
 <a name="unregister_name-1"></a>
 
 ### unregister_name/1 ###
@@ -1750,108 +1550,92 @@ Unregister a shared resource.
 `unregister_name(Key) -> any()`
 
 Equivalent to `unreg / 1`.
+
 <a name="update_counter-2"></a>
 
 ### update_counter/2 ###
 
-
 <pre><code>
 update_counter(Key::<a href="#type-key">key()</a>, Incr::<a href="#type-increment">increment()</a>) -&gt; integer()
 </code></pre>
 <br />
 
-
 Updates the counter registered as Key for the current process.
 
-
-
 This function works almost exactly like ets:update_counter/3
 (see [`http://www.erlang.org/doc/man/ets.html#update_counter-3`](http://www.erlang.org/doc/man/ets.html#update_counter-3)), but
 will fail if the type of object referred to by Key is not a counter or
 a unique name (update_counter/2 can be performed on names as well, but they
 do not count as counter objects, and do not affect aggregated counters).
 
-
-
 Aggregated counters with the same name will be updated automatically.
 The `UpdateOp` patterns are the same as for `ets:update_counter/3`, except
 that the position is omitted; in gproc, the value position is always `3`.
 
-
 If `Key` refers to a unique name, the operation will depend on the value
 part of the registration being an integer(). While non-integer values are
 not permitted at all for counter objects, it is the user's responsibility to
 ensure that a name, on which `update_counter/2` is to be performed, has the
 appropriate value type.
+
 <a name="update_counter-3"></a>
 
 ### update_counter/3 ###
 
 `update_counter(Key, Pid, Incr) -> any()`
 
-
 <a name="update_counters-2"></a>
 
 ### update_counters/2 ###
 
-
 <pre><code>
 update_counters(X1::<a href="#type-scope">scope()</a>, Cs::[{<a href="#type-key">key()</a>, pid(), <a href="#type-increment">increment()</a>}]) -&gt; [{<a href="#type-key">key()</a>, pid(), integer()}]
 </code></pre>
 <br />
 
-
 Update a list of counters
 
-
-
 This function is not atomic, except (in a sense) for global counters. For local counters,
 it is more of a convenience function. For global counters, it is much more efficient
 than calling `gproc:update_counter/2` for each individual counter.
 
-
 The return value is the corresponding list of `[{Counter, Pid, NewValue}]`.
+
 <a name="update_shared_counter-2"></a>
 
 ### update_shared_counter/2 ###
 
-
 <pre><code>
 update_shared_counter(Key::<a href="#type-key">key()</a>, Incr) -&gt; integer() | [integer()]
 </code></pre>
 
 <ul class="definitions"><li><code>Incr = IncrVal | UpdateOp | [UpdateOp]</code></li><li><code>UpdateOp = IncrVal | {IncrVal, Threshold, SetValue}</code></li><li><code>IncrVal = integer()</code></li></ul>
 
-
 Updates the shared counter registered as Key.
 
-
-
 This function works almost exactly like ets:update_counter/3
 (see [`http://www.erlang.org/doc/man/ets.html#update_counter-3`](http://www.erlang.org/doc/man/ets.html#update_counter-3)), but
 will fail if the type of object referred to by Key is not a counter.
 
-
 Aggregated counters with the same name will be updated automatically.
 The `UpdateOp` patterns are the same as for `ets:update_counter/3`, except
 that the position is omitted; in gproc, the value position is always `3`.
+
 <a name="where-1"></a>
 
 ### where/1 ###
 
-
 <pre><code>
 where(Key::<a href="#type-key">key()</a>) -&gt; pid() | undefined
 </code></pre>
 <br />
 
-
 Returns the pid registered as Key
 
-
 The type of registration must be either name or aggregated counter.
 Otherwise this function will raise a `badarg` exception.
 Use [`lookup_pids/1`](#lookup_pids-1) in these cases.
+
 <a name="whereis_name-1"></a>
 
 ### whereis_name/1 ###
@@ -1859,24 +1643,23 @@ Use [`lookup_pids/1`](#lookup_pids-1) in these cases.
 `whereis_name(Key) -> any()`
 
 Equivalent to `where / 1`.
+
 <a name="wide_await-3"></a>
 
 ### wide_await/3 ###
 
-
 <pre><code>
 wide_await(Nodes::[node()], Key::<a href="#type-key">key()</a>, Timeout) -&gt; {pid(), Value}
 </code></pre>
 
 <ul class="definitions"><li><code>Timeout = integer() | infinity</code></li></ul>
 
-
 Wait for a local name to be registered on any of `Nodes`.
 This function works rather like [`await/2`](#await-2), but queries all nodes in
 the `Nodes` list at the same time. The first node to respond with a
 process registered as `Key` will provide the result. Other results are
 ignored. `Key` must be a unique name with local scope, i.e. `{n,l,Name}`.
 
-
 An exception is thrown upon timeout, or if no node can be reached (if gproc is
 not running on a given node, this is treated the same as the node being down).
+

+ 1 - 3
doc/gproc_app.md

@@ -5,6 +5,7 @@
 * [Function Details](#functions)
 
 __Behaviours:__ [`application`](application.md).
+
 <a name="index"></a>
 
 ## Function Index ##
@@ -23,18 +24,15 @@ __Behaviours:__ [`application`](application.md).
 
 `start() -> any()`
 
-
 <a name="start-2"></a>
 
 ### start/2 ###
 
 `start(Type, StartArgs) -> any()`
 
-
 <a name="stop-1"></a>
 
 ### stop/1 ###
 
 `stop(State) -> any()`
 
-

+ 2 - 10
doc/gproc_bcast.md

@@ -5,17 +5,16 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
 Gproc message broadcast server
 This module is used to support gproc:bcast(Key, Msg).
+
 __Behaviours:__ [`gen_server`](gen_server.md).
 
 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
+
 <a name="description"></a>
 
 ## Description ##
-
-
 gproc:bcast/2 allows for e.g. distributed publish/subscribe, without
 having to resort to global property registration.
 To ensure that erlang's message ordering guarantees are kept, all sends
@@ -37,46 +36,39 @@ are channeled through a broadcast server on each node.<a name="index"></a>
 
 `code_change(X1, S, X3) -> any()`
 
-
 <a name="handle_call-3"></a>
 
 ### handle_call/3 ###
 
 `handle_call(X1, X2, S) -> any()`
 
-
 <a name="handle_cast-2"></a>
 
 ### handle_cast/2 ###
 
 `handle_cast(X1, S) -> any()`
 
-
 <a name="handle_info-2"></a>
 
 ### handle_info/2 ###
 
 `handle_info(X1, S) -> any()`
 
-
 <a name="init-1"></a>
 
 ### init/1 ###
 
 `init(X1) -> any()`
 
-
 <a name="start_link-0"></a>
 
 ### start_link/0 ###
 
 `start_link() -> any()`
 
-
 <a name="terminate-2"></a>
 
 ### terminate/2 ###
 
 `terminate(X1, X2) -> any()`
 
-

+ 6 - 43
doc/gproc_dist.md

@@ -5,19 +5,20 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
 Extended process registry.
+
 __Behaviours:__ [`gen_leader`](gen_leader.md).
 
 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
+
 <a name="description"></a>
 
 ## Description ##
 
 This module implements an extended process registry
 
-
 For a detailed description, see gproc/doc/erlang07-wiger.pdf.
+
 <a name="index"></a>
 
 ## Function Index ##
@@ -41,247 +42,214 @@ Scope = l | g (global or local).</td></tr><tr><td valign="top"><a href="#reg_or_
 
 `code_change(FromVsn, S, Extra, E) -> any()`
 
-
 <a name="demonitor-2"></a>
 
 ### demonitor/2 ###
 
 `demonitor(Key, Ref) -> any()`
 
-
 <a name="elected-2"></a>
 
 ### elected/2 ###
 
 `elected(S, E) -> any()`
 
-
 <a name="elected-3"></a>
 
 ### elected/3 ###
 
 `elected(S, E, Node) -> any()`
 
-
 <a name="from_leader-3"></a>
 
 ### from_leader/3 ###
 
 `from_leader(Ops, S, E) -> any()`
 
-
 <a name="get_leader-0"></a>
 
 ### get_leader/0 ###
 
-
 <pre><code>
 get_leader() -&gt; node()
 </code></pre>
 <br />
 
 Returns the node of the current gproc leader.
+
 <a name="give_away-2"></a>
 
 ### give_away/2 ###
 
 `give_away(Key, To) -> any()`
 
-
 <a name="handle_DOWN-3"></a>
 
 ### handle_DOWN/3 ###
 
 `handle_DOWN(Node, S, E) -> any()`
 
-
 <a name="handle_call-4"></a>
 
 ### handle_call/4 ###
 
 `handle_call(X1, X2, S, E) -> any()`
 
-
 <a name="handle_cast-3"></a>
 
 ### handle_cast/3 ###
 
 `handle_cast(Msg, S, X3) -> any()`
 
-
 <a name="handle_info-2"></a>
 
 ### handle_info/2 ###
 
 `handle_info(X1, S) -> any()`
 
-
 <a name="handle_info-3"></a>
 
 ### handle_info/3 ###
 
 `handle_info(Msg, S, E) -> any()`
 
-
 <a name="handle_leader_call-4"></a>
 
 ### handle_leader_call/4 ###
 
 `handle_leader_call(X1, From, State, E) -> any()`
 
-
 <a name="handle_leader_cast-3"></a>
 
 ### handle_leader_cast/3 ###
 
 `handle_leader_cast(X1, S, E) -> any()`
 
-
 <a name="init-1"></a>
 
 ### init/1 ###
 
 `init(Opts) -> any()`
 
-
 <a name="leader_call-1"></a>
 
 ### leader_call/1 ###
 
 `leader_call(Req) -> any()`
 
-
 <a name="leader_cast-1"></a>
 
 ### leader_cast/1 ###
 
 `leader_cast(Msg) -> any()`
 
-
 <a name="monitor-2"></a>
 
 ### monitor/2 ###
 
 `monitor(Key, Type) -> any()`
 
-
 <a name="mreg-2"></a>
 
 ### mreg/2 ###
 
 `mreg(T, KVL) -> any()`
 
-
 <a name="munreg-2"></a>
 
 ### munreg/2 ###
 
 `munreg(T, Keys) -> any()`
 
-
 <a name="reg-1"></a>
 
 ### reg/1 ###
 
 `reg(Key) -> any()`
 
-
 <a name="reg-3"></a>
 
 ### reg/3 ###
 
 `reg(Key, Value, Attrs) -> any()`
 
-
 Class = n  - unique name
 | p  - non-unique property
 | c  - counter
 | a  - aggregated counter
 Scope = l | g (global or local)
+
 <a name="reg_or_locate-3"></a>
 
 ### reg_or_locate/3 ###
 
 `reg_or_locate(Key, Value, Pid) -> any()`
 
-
 <a name="reg_shared-3"></a>
 
 ### reg_shared/3 ###
 
 `reg_shared(Key, Value, Attrs) -> any()`
 
-
 <a name="reset_counter-1"></a>
 
 ### reset_counter/1 ###
 
 `reset_counter(Key) -> any()`
 
-
 <a name="set_attributes-2"></a>
 
 ### set_attributes/2 ###
 
 `set_attributes(Key, Attrs) -> any()`
 
-
 <a name="set_attributes_shared-2"></a>
 
 ### set_attributes_shared/2 ###
 
 `set_attributes_shared(Key, Attrs) -> any()`
 
-
 <a name="set_value-2"></a>
 
 ### set_value/2 ###
 
 `set_value(Key, Value) -> any()`
 
-
 <a name="set_value_shared-2"></a>
 
 ### set_value_shared/2 ###
 
 `set_value_shared(Key, Value) -> any()`
 
-
 <a name="start_link-0"></a>
 
 ### start_link/0 ###
 
 `start_link() -> any()`
 
-
 <a name="start_link-1"></a>
 
 ### start_link/1 ###
 
 `start_link(Nodes) -> any()`
 
-
 <a name="surrendered-3"></a>
 
 ### surrendered/3 ###
 
 `surrendered(State, X2, E) -> any()`
 
-
 <a name="sync-0"></a>
 
 ### sync/0 ###
 
-
 <pre><code>
 sync() -&gt; true
 </code></pre>
 <br />
 
-
 Synchronize with the gproc leader
 
-
 This function can be used to ensure that data has been replicated from the
 leader to the current node. It does so by asking the leader to ping all
 live participating nodes. The call will return `true` when all these nodes
@@ -290,45 +258,40 @@ during an ongoing sync, the call will fail with a timeout exception.
 (Actually, it should be a `leader_died` exception; more study needed to find
 out why gen_leader times out in this situation, rather than reporting that
 the leader died.)
+
 <a name="terminate-2"></a>
 
 ### terminate/2 ###
 
 `terminate(Reason, S) -> any()`
 
-
 <a name="unreg-1"></a>
 
 ### unreg/1 ###
 
 `unreg(Key) -> any()`
 
-
 <a name="unreg_shared-1"></a>
 
 ### unreg_shared/1 ###
 
 `unreg_shared(Key) -> any()`
 
-
 <a name="update_counter-3"></a>
 
 ### update_counter/3 ###
 
 `update_counter(Key, Pid, Incr) -> any()`
 
-
 <a name="update_counters-1"></a>
 
 ### update_counters/1 ###
 
 `update_counters(List) -> any()`
 
-
 <a name="update_shared_counter-2"></a>
 
 ### update_shared_counter/2 ###
 
 `update_shared_counter(Key, Incr) -> any()`
 
-

+ 1 - 2
doc/gproc_info.md

@@ -5,6 +5,7 @@
 * [Function Details](#functions)
 
 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
+
 <a name="index"></a>
 
 ## Function Index ##
@@ -21,10 +22,8 @@ __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
 
 ### i/0 ###
 
-
 <pre><code>
 i() -&gt; ok
 </code></pre>
 <br />
 
-

+ 0 - 5
doc/gproc_init.md

@@ -4,7 +4,6 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
 <a name="index"></a>
 
 ## Function Index ##
@@ -21,21 +20,17 @@
 
 ### hard_reset/0 ###
 
-
 <pre><code>
 hard_reset() -&gt; ok
 </code></pre>
 <br />
 
-
 <a name="soft_reset-0"></a>
 
 ### soft_reset/0 ###
 
-
 <pre><code>
 soft_reset() -&gt; ok
 </code></pre>
 <br />
 
-

+ 3 - 32
doc/gproc_lib.md

@@ -5,17 +5,18 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
 Extended process registry.
+
 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
+
 <a name="description"></a>
 
 ## Description ##
 
 This module implements an extended process registry
 
-
 For a detailed description, see gproc/doc/erlang07-wiger.pdf.
+
 <a name="index"></a>
 
 ## Function Index ##
@@ -34,201 +35,171 @@ For a detailed description, see gproc/doc/erlang07-wiger.pdf.
 
 `add_monitor(T, Pid, Ref, Type) -> any()`
 
-
 <a name="await-3"></a>
 
 ### await/3 ###
 
 `await(Key, WPid, From) -> any()`
 
-
 <a name="dbg-1"></a>
 
 ### dbg/1 ###
 
 `dbg(Mods) -> any()`
 
-
 <a name="decrement_resource_count-2"></a>
 
 ### decrement_resource_count/2 ###
 
 `decrement_resource_count(C, N) -> any()`
 
-
 <a name="do_set_counter_value-3"></a>
 
 ### do_set_counter_value/3 ###
 
 `do_set_counter_value(Key, Value, Pid) -> any()`
 
-
 <a name="do_set_value-3"></a>
 
 ### do_set_value/3 ###
 
 `do_set_value(Key, Value, Pid) -> any()`
 
-
 <a name="ensure_monitor-2"></a>
 
 ### ensure_monitor/2 ###
 
 `ensure_monitor(Pid, Scope) -> any()`
 
-
 <a name="followers-1"></a>
 
 ### followers/1 ###
 
 `followers(Opts) -> any()`
 
-
 <a name="insert_attr-4"></a>
 
 ### insert_attr/4 ###
 
 `insert_attr(Key, Attrs, Pid, Scope) -> any()`
 
-
 <a name="insert_many-4"></a>
 
 ### insert_many/4 ###
 
-
 <pre><code>
 insert_many(T::<a href="gproc.md#type-type">gproc:type()</a>, Scope::<a href="gproc.md#type-scope">gproc:scope()</a>, KVL::[{<a href="gproc.md#type-key">gproc:key()</a>, any()}], Pid::pid()) -&gt; {true, list()} | false
 </code></pre>
 <br />
 
-
 <a name="insert_reg-4"></a>
 
 ### insert_reg/4 ###
 
-
 <pre><code>
 insert_reg(K::<a href="gproc.md#type-key">gproc:key()</a>, Value::any(), Pid::pid() | shared, Scope::<a href="gproc.md#type-scope">gproc:scope()</a>) -&gt; boolean()
 </code></pre>
 <br />
 
-
 <a name="insert_reg-5"></a>
 
 ### insert_reg/5 ###
 
 `insert_reg(K, Value, Pid, Scope, Event) -> any()`
 
-
 <a name="monitors-1"></a>
 
 ### monitors/1 ###
 
 `monitors(Opts) -> any()`
 
-
 <a name="notify-2"></a>
 
 ### notify/2 ###
 
 `notify(Key, Opts) -> any()`
 
-
 <a name="notify-3"></a>
 
 ### notify/3 ###
 
 `notify(Event, Key, Opts) -> any()`
 
-
 <a name="remove_many-4"></a>
 
 ### remove_many/4 ###
 
 `remove_many(T, Scope, L, Pid) -> any()`
 
-
 <a name="remove_monitor-3"></a>
 
 ### remove_monitor/3 ###
 
 `remove_monitor(T, Pid, Ref) -> any()`
 
-
 <a name="remove_monitor_pid-2"></a>
 
 ### remove_monitor_pid/2 ###
 
 `remove_monitor_pid(T, Pid) -> any()`
 
-
 <a name="remove_monitors-3"></a>
 
 ### remove_monitors/3 ###
 
 `remove_monitors(Key, Pid, MPid) -> any()`
 
-
 <a name="remove_reg-3"></a>
 
 ### remove_reg/3 ###
 
 `remove_reg(Key, Pid, Event) -> any()`
 
-
 <a name="remove_reg-4"></a>
 
 ### remove_reg/4 ###
 
 `remove_reg(Key, Pid, Event, Opts) -> any()`
 
-
 <a name="remove_reverse_mapping-3"></a>
 
 ### remove_reverse_mapping/3 ###
 
 `remove_reverse_mapping(Event, Pid, Key) -> any()`
 
-
 <a name="remove_reverse_mapping-4"></a>
 
 ### remove_reverse_mapping/4 ###
 
 `remove_reverse_mapping(Event, Pid, Key, Opts) -> any()`
 
-
 <a name="remove_wait-4"></a>
 
 ### remove_wait/4 ###
 
 `remove_wait(Key, Pid, Ref, Waiters) -> any()`
 
-
 <a name="standbys-1"></a>
 
 ### standbys/1 ###
 
 `standbys(Opts) -> any()`
 
-
 <a name="update_aggr_counter-3"></a>
 
 ### update_aggr_counter/3 ###
 
 `update_aggr_counter(C, N, Val) -> any()`
 
-
 <a name="update_counter-3"></a>
 
 ### update_counter/3 ###
 
 `update_counter(Key, Incr, Pid) -> any()`
 
-
 <a name="valid_opts-2"></a>
 
 ### valid_opts/2 ###
 
 `valid_opts(Type, Default) -> any()`
 
-

+ 4 - 14
doc/gproc_monitor.md

@@ -5,14 +5,14 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
-
 This module implements a notification system for gproc names
 When a process subscribes to notifications for a given name, a message
 will be sent each time that name is registered.
+
 __Behaviours:__ [`gen_server`](gen_server.md).
 
 __Authors:__ Ulf Wiger ([`ulf.wiger@feuerlabs.com`](mailto:ulf.wiger@feuerlabs.com)).
+
 <a name="index"></a>
 
 ## Function Index ##
@@ -32,52 +32,42 @@ Unsubscribe from registration events for a certain name.</td></tr></table>
 
 ### start_link/0 ###
 
-
 <pre><code>
 start_link() -&gt; {ok, Pid} | ignore | {error, Error}
 </code></pre>
 <br />
 
-
 Starts the server
 
 <a name="subscribe-1"></a>
 
 ### subscribe/1 ###
 
-
 <pre><code>
 subscribe(Key::<a href="#type-key">key()</a>) -&gt; ok
 </code></pre>
 <br />
 
-
-
 Subscribe to registration events for a certain name
 
-
-
 The subscribing process will receive a `{gproc_monitor, Name, Pid}` message
 whenever a process registers under the given name, and a
 `{gproc_monitor, Name, undefined}` message when the name is unregistered,
 either explicitly, or because the registered process dies.
 
-
 When the subscription is first ordered, one of the above messages will be
 sent immediately, indicating the current status of the name.
+
 <a name="unsubscribe-1"></a>
 
 ### unsubscribe/1 ###
 
-
 <pre><code>
 unsubscribe(Key::<a href="#type-key">key()</a>) -&gt; ok
 </code></pre>
 <br />
 
-
-
 Unsubscribe from registration events for a certain name
 
-
 This function is the reverse of subscribe/1. It removes the subscription.
+

+ 23 - 96
doc/gproc_pool.md

@@ -5,49 +5,37 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
 Load balancing functions based on Gproc.
+
 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
+
 <a name="description"></a>
 
 ## Description ##
 
-
-
 This module implements support for load-balancing server pools. It was
 originally intended mainly as an example of how to use various Gproc
 resources (e.g. counters and shared properties), but is fully integrated
 into Gproc, and fully functional.
 
 
-
-
 ## Concepts ##
 
-
-
 Each pool has a list of 'named' workers (defined using `add_worker/2`) and
 a load-balancing strategy. Processes can then 'connect' to the pool (with
 `connect_worker/2`), using one of the defined names.
 
-
-
 Users then 'pick' one of the currently connected processes in the pool. Which
 process is picked depends on the load-balancing strategy.
 
-
-
 The whole representation of the pool and its connected workers is in gproc.
 The server `gproc_pool` is used to serialize pool management updates, but
 worker selection is performed entirely in the calling process, and can be
 performed by several processes concurrently.
 
 
-
-
 ### Load-balancing strategies ###
 
-
 * `round_robin` is the default. A wrapping gproc counter keeps track of the
 latest worker picked, and `gproc:next()` is used to find the next worker.
 * `random` picks a random worker from the pool.
@@ -74,7 +62,6 @@ jobs will not exceed the size of the pool.<a name="index"></a>
 
 ### active_workers/1 ###
 
-
 <pre><code>
 active_workers(Pool::any()) -&gt; [{Name, Pid}]
 </code></pre>
@@ -86,17 +73,13 @@ Return a list of currently connected workers in the pool.
 
 ### add_worker/2 ###
 
-
 <pre><code>
 add_worker(Pool::any(), Name::any()) -&gt; integer()
 </code></pre>
 <br />
 
-
 Assign a worker name to the pool, returning the worker's position.
 
-
-
 Before a worker can connect to the pool, its name must be added. If no explicit
 position is given (see [`add_worker/3`](#add_worker-3)), the most suitable position,
 depending on load-balancing algorithm, is selected: for round_robin and direct
@@ -104,33 +87,29 @@ pools, names are packed tightly from the beginning; for hash and random pools,
 slots are filled as sparsely as possible, in order to maintain an even
 likelihood of hitting each worker.
 
-
-
 An exception is raised if the pool is full (and `auto_size` is false), or if
 `Name` already exists in the pool.
 
-
 Before a worker can be used, a process must connect to it (see
 [`connect_worker/2`](#connect_worker-2).
+
 <a name="add_worker-3"></a>
 
 ### add_worker/3 ###
 
-
 <pre><code>
 add_worker(Pool::any(), Name::any(), Slot::integer()) -&gt; integer()
 </code></pre>
 <br />
 
-
 Assign a worker name to a given slot in the pool, returning the slot.
 
-
 This function allows the pool maintainer to exactly position each worker
 inside the pool. An exception is raised if the position is already taken,
 or if `Name` already exists in the pool. If `Slot` is larger than the current
 size of the pool, an exception is raised iff `auto_size` is `false`;
 otherwise the pool is expanded to accomodate the new position.
+
 <a name="claim-2"></a>
 
 ### claim/2 ###
@@ -138,22 +117,19 @@ otherwise the pool is expanded to accomodate the new position.
 `claim(Pool, F) -> any()`
 
 Equivalent to [`claim(Pool, F, nowait)`](#claim-3).
+
 <a name="claim-3"></a>
 
 ### claim/3 ###
 
-
 <pre><code>
 claim(Pool, F::Fun, Wait) -&gt; {true, Res} | false
 </code></pre>
 
 <ul class="definitions"><li><code>Pool = any()</code></li><li><code>Fun = function()</code></li><li><code>Wait = nowait | {busy_wait, integer()}</code></li></ul>
 
-
 Picks the first available worker in the pool and applies `Fun`.
 
-
-
 A `claim` pool allows the caller to "claim" a worker during a short span
 (essentially, a lock is set and released as soon as `Fun` returns).
 Once a worker is selected, `Fun(Name, Pid)` is called, where `Name` is a
@@ -162,30 +138,24 @@ The gproc name of the worker serves as a mutex, where its value is 0 (zero)
 if the worker is free, and 1 (one) if it is busy. The mutex operation is
 implemented using `gproc:update_counter/2`.
 
-
-
 `Wait == nowait` means that the call will return `false` immediately if
 there is no available worker.
 
-
 `Wait == {busy_wait, Timeout}` will keep repeating the claim attempt
 for `Timeout` milliseconds. If still no worker is available, it will
 return `false`.
+
 <a name="connect_worker-2"></a>
 
 ### connect_worker/2 ###
 
-
 <pre><code>
 connect_worker(Pool::any(), Name::any()) -&gt; true
 </code></pre>
 <br />
 
-
 Connect the current process to `Name` in `Pool`.
 
-
-
 Typically, a server will call this function as it starts, similarly to when
 it registers itself. In fact, calling `connect_worker/2` leads to the process
 being registered as `{n,l,[gproc_pool,N,Name]}`, where `N` is the position of
@@ -193,135 +163,117 @@ being registered as `{n,l,[gproc_pool,N,Name]}`, where `N` is the position of
 removes the connection automatically if it dies, and (b) that the registered
 names can be listed in order of their positions in the pool.
 
-
 This function raises an exception if `Name` does not exist in `Pool` (or
 there is no such pool), or if another worker is already connected to
 `Name`.
+
 <a name="defined_workers-1"></a>
 
 ### defined_workers/1 ###
 
-
 <pre><code>
 defined_workers(Pool::any()) -&gt; [{Name, Pos, Count}]
 </code></pre>
 <br />
 
-
 Return a list of added workers in the pool.
 
-
-
 The added workers are slots in the pool that have been given names, and thus
 can be connected to. This function doesn't detect whether or not there are
 any connected (active) workers.
 
-
 The list contains `{Name, Pos, Count}`, where `Name` is the name of the added
 worker, `Pos` is its position in the pool, and `Count` represents the number
 of times the worker has been picked (assuming callers keep count by explicitly
 calling [`log/1`](#log-1)).
+
 <a name="delete-1"></a>
 
 ### delete/1 ###
 
-
 <pre><code>
 delete(Pool::any()) -&gt; true
 </code></pre>
 <br />
 
-
 Delete an existing pool.
 
-
 This function will delete a pool, only if there are no connected workers.
 Ensure that workers have been disconnected before deleting the pool.
+
 <a name="disconnect_worker-2"></a>
 
 ### disconnect_worker/2 ###
 
-
 <pre><code>
 disconnect_worker(Pool, Name) -&gt; true
 </code></pre>
 <br />
 
-
 Disconnect the current process from `Name` in `Pool`.
 
-
-
 This function is similar to a `gproc:unreg()` call. It removes the
 connection between `Pool`, `Name` and pid, and makes it possible for another
 process to connect to `Name`.
 
-
 An exception is raised if there is no prior connection between `Pool`,
 `Name` and the current process.
+
 <a name="force_delete-1"></a>
 
 ### force_delete/1 ###
 
-
 <pre><code>
 force_delete(Pool::any()) -&gt; true
 </code></pre>
 <br />
 
-
 Forcibly remove a pool, terminating all active workers
 
-
 This function is primarily intended for cleanup of any pools that might have
 become inconsistent (for whatever reason). It will clear out all resources
 belonging to the pool and send `exit(Pid, kill)` signals to all connected
 workers (except the calling process).
+
 <a name="log-1"></a>
 
 ### log/1 ###
 
-
 <pre><code>
 log(X1::GprocKey) -&gt; integer()
 </code></pre>
 <br />
 
-
 Update a counter associated with a worker name.
 
-
 Each added worker has a gproc counter that can be used e.g. to keep track of
 the number of times the worker has been picked. Since it's associated with the
 named 'slot', and not to the connected worker, its value will persist even
 if the currently connected worker dies.
+
 <a name="new-1"></a>
 
 ### new/1 ###
 
-
 <pre><code>
 new(Pool::any()) -&gt; ok
 </code></pre>
 <br />
 
 Equivalent to [`new(Pool, round_robin, [])`](#new-3).
+
 <a name="new-3"></a>
 
 ### new/3 ###
 
-
 <pre><code>
 new(Pool::any(), Type, Opts) -&gt; true
 </code></pre>
 
 <ul class="definitions"><li><code>Type = round_robin | random | hash | direct | claim</code></li><li><code>Opts = [{size, integer()} | {auto_size, boolean()}]</code></li></ul>
 
-
 Create a new pool.
 
-
-
 The pool starts out empty. If a size is not given, the pool size is set to
 0 initially. `auto_size` is `true` by default if size is not specified, but
 `false` by default otherwise. If `auto_size == true`, the pool will be
@@ -329,187 +281,162 @@ enlarged to accomodate new workers, when necessary. Otherwise, trying to add
 a worker when the pool is full will raise an exception, as will trying to add
 a worker on a specific position beyond the current size of the pool.
 
-
 If the given pool already exists, this function will raise an exception.
+
 <a name="pick-1"></a>
 
 ### pick/1 ###
 
-
 <pre><code>
 pick(Pool::any()) -&gt; GprocName | false
 </code></pre>
 <br />
 
-
 Pick a worker from the pool given the pool's load-balancing algorithm.
 
-
 The pool types that allows picking without an extra argument are
 round_robin and random. This function returns `false` if there is no available
 worker, or if `Pool` is not a valid pool.
+
 <a name="pick-2"></a>
 
 ### pick/2 ###
 
-
 <pre><code>
 pick(Pool::any(), Value::any()) -&gt; GprocName | false
 </code></pre>
 <br />
 
-
 Pick a worker from the pool based on `Value`.
 
-
-
 The pool types that allows picking based on an extra argument are
 hash and direct. This function returns `false` if there is no available
 worker, or if `Pool` is not a valid pool.
 
-
 If the pool is of type `direct`, `Value` must be an integer corresponding to
 a position in the pool (modulo the size of the pool). If the type is
 `hash`, `Value` may be any term, and its hash value will serve as a guide for
 selecting a worker.
+
 <a name="pick_worker-1"></a>
 
 ### pick_worker/1 ###
 
-
 <pre><code>
 pick_worker(Pool::any()) -&gt; pid() | false
 </code></pre>
 <br />
 
-
 Pick a worker pid from the pool given the pool's load-balancing algorithm.
 
-
 Like [`pick/1`](#pick-1), but returns the worker pid instead of the name.
+
 <a name="pick_worker-2"></a>
 
 ### pick_worker/2 ###
 
-
 <pre><code>
 pick_worker(Pool::any(), Value::any()) -&gt; pid() | false
 </code></pre>
 <br />
 
-
 Pick a worker pid from the pool given the pool's load-balancing algorithm.
 
-
 Like [`pick/2`](#pick-2), but returns the worker pid instead of the name.
+
 <a name="ptest-4"></a>
 
 ### ptest/4 ###
 
 `ptest(N, I, Type, Opts) -> any()`
 
-
 <a name="randomize-1"></a>
 
 ### randomize/1 ###
 
-
 <pre><code>
 randomize(Pool::any()) -&gt; integer()
 </code></pre>
 <br />
 
-
 Randomizes the "next" pointer for the pool.
 
-
 This function only has an effect for `round_robin` pools, which have a
 reference to the next worker to be picked. Without randomizing, the load
 balancing will always start with the first worker in the pool.
+
 <a name="remove_worker-2"></a>
 
 ### remove_worker/2 ###
 
-
 <pre><code>
 remove_worker(Pool::any(), Name::any()) -&gt; true
 </code></pre>
 <br />
 
-
 Remove a previously added worker.
 
-
 This function will assume that any connected worker is disconnected first.
 It will fail if there is no such pool, but will return `true` in the case
 when `Name` did not exist in the pool in the first place.
+
 <a name="setup_test_pool-4"></a>
 
 ### setup_test_pool/4 ###
 
 `setup_test_pool(P, Type0, Opts, Workers) -> any()`
 
-
 <a name="test_run0-2"></a>
 
 ### test_run0/2 ###
 
 `test_run0(N, X) -> any()`
 
-
 <a name="whereis_worker-2"></a>
 
 ### whereis_worker/2 ###
 
-
 <pre><code>
 whereis_worker(Pool::any(), Name::any()) -&gt; pid() | undefined
 </code></pre>
 <br />
 
-
 Look up the pid of a connected worker.
 
-
 This function works similarly to `gproc:where/1`: it will return the pid
 of the worker connected as `Pool / Name`, if there is such a worker; otherwise
 it will return `undefined`. It will raise an exception if `Name` has not been
 added to the pool.
+
 <a name="worker_id-2"></a>
 
 ### worker_id/2 ###
 
-
 <pre><code>
 worker_id(Pool, Name) -&gt; GprocName
 </code></pre>
 <br />
 
-
 Return the unique gproc name corresponding to a name in the pool.
 
-
 This function assumes that `Name` has been added to `Pool`. It returns the
 unique name that a connected worker will be registered as. This doesn't mean
 that there is, in fact, such a connected worker.
+
 <a name="worker_pool-1"></a>
 
 ### worker_pool/1 ###
 
-
 <pre><code>
 worker_pool(Pool::any()) -&gt; [integer() | {Name, Pos}]
 </code></pre>
 <br />
 
-
 Return a list of slots and/or named workers in the pool.
 
-
-
 This function is mainly for testing, but can also be useful when implementing
 your own worker placement algorithm on top of gproc_pool.
 
-
 A plain integer represents an unfilled slot, and `{Name, Pos}` represents an
 added worker. The pool is always filled to the current size.
+

+ 16 - 89
doc/gproc_ps.md

@@ -6,21 +6,19 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
 Gproc Publish/Subscribe patterns
 This module implements a few convenient functions for publish/subscribe.
+
 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
+
 <a name="description"></a>
 
 ## Description ##
 
-
-
 Publish/subscribe with Gproc relies entirely on gproc properties and counters.
 This makes for a very concise implementation, as the monitoring of subscribers and
 removal of subscriptions comes for free with Gproc.
 
-
 Using this module instead of rolling your own (which is easy enough) brings the
 benefit of consistency, in tracing and debugging.
 The implementation can also serve to illustrate how to use gproc properties and
@@ -36,7 +34,6 @@ counters to good effect.
 ### <a name="type-event">event()</a> ###
 
 
-
 <pre><code>
 event() = any()
 </code></pre>
@@ -44,11 +41,9 @@ event() = any()
 
 
 
-
 ### <a name="type-msg">msg()</a> ###
 
 
-
 <pre><code>
 msg() = any()
 </code></pre>
@@ -56,11 +51,9 @@ msg() = any()
 
 
 
-
 ### <a name="type-scope">scope()</a> ###
 
 
-
 <pre><code>
 scope() = l | g
 </code></pre>
@@ -68,16 +61,13 @@ scope() = l | g
 
 
 
-
 ### <a name="type-status">status()</a> ###
 
 
-
 <pre><code>
 status() = 1 | 0
 </code></pre>
 
-
 <a name="index"></a>
 
 ## Function Index ##
@@ -94,270 +84,215 @@ status() = 1 | 0
 
 ### change_cond/3 ###
 
-
 <pre><code>
 change_cond(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>, Spec::undefined | <a href="ets.md#type-match_spec">ets:match_spec()</a>) -&gt; true
 </code></pre>
 <br />
 
-
 Change the condition specification of an existing subscription.
 
-
-
 This function atomically changes the condition spec of an existing
 subscription (see [`subscribe_cond/3`](#subscribe_cond-3)). An exception is raised if
 the subscription doesn't already exist.
 
-
 Note that this function can also be used to change a conditional subscription
 to an unconditional one (by setting `Spec = undefined`), or a 'normal'
 subscription to a conditional one.
+
 <a name="create_single-2"></a>
 
 ### create_single/2 ###
 
-
 <pre><code>
 create_single(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>) -&gt; true
 </code></pre>
 <br />
 
-
 Creates a single-shot subscription entry for Event
 
-
-
 Single-shot subscriptions behave similarly to the `{active,once}` property of sockets.
 Once a message has been published, the subscription is disabled, and no more messages
 will be delivered to the subscriber unless the subscription is re-enabled using
 `enable_single/2`.
 
-
-
 The function creates a gproc counter entry, `{c,Scope,{gproc_ps_event,Event}}`, which
 will have either of the values `0` (disabled) or `1` (enabled). Initially, the value
 is `1`, meaning the subscription is enabled.
 
-
 Counters are used in this case, since they can be atomically updated by both the
 subscriber (owner) and publisher. The publisher sets the counter value to `0` as soon
 as it has delivered a message.
+
 <a name="delete_single-2"></a>
 
 ### delete_single/2 ###
 
-
 <pre><code>
 delete_single(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>) -&gt; true
 </code></pre>
 <br />
 
-
 Deletes the single-shot subscription for Event
 
-
 This function deletes the counter entry representing the single-shot description.
 An exception will be raised if there is no such subscription.
+
 <a name="disable_single-2"></a>
 
 ### disable_single/2 ###
 
-
 <pre><code>
 disable_single(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>) -&gt; integer()
 </code></pre>
 <br />
 
-
 Disables the single-shot subscription for Event
 
-
-
 This function changes the value of the corresponding gproc counter to `0` (disabled).
 
-
-
 The subscription remains (e.g. for debugging purposes), but with a 'disabled' status.
 This function is insensitive to concurrency, using 'wrapping' ets counter update ops.
 This guarantees that the counter will have either the value 1 or 0, depending on which
 update happened last.
 
-
 The return value indicates the previous status.
+
 <a name="enable_single-2"></a>
 
 ### enable_single/2 ###
 
-
 <pre><code>
 enable_single(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>) -&gt; integer()
 </code></pre>
 <br />
 
-
 Enables the single-shot subscription for Event
 
-
-
 This function changes the value of the corresponding gproc counter to `1` (enabled).
 
-
-
 After enabling, the subscriber will receive the next message published for `Event`,
 after which the subscription is automatically disabled.
 
-
-
 This function is insensitive to concurrency, using 'wrapping' ets counter update ops.
 This guarantees that the counter will have either the value 1 or 0, depending on which
 update happened last.
 
-
 The return value indicates the previous status.
+
 <a name="list_singles-2"></a>
 
 ### list_singles/2 ###
 
-
 <pre><code>
 list_singles(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>) -&gt; [{pid(), <a href="#type-status">status()</a>}]
 </code></pre>
 <br />
 
 Lists all single-shot subscribers of Event, together with their status
+
 <a name="list_subs-2"></a>
 
 ### list_subs/2 ###
 
-
 <pre><code>
 list_subs(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>) -&gt; [pid()]
 </code></pre>
 <br />
 
-
 List the pids of all processes subscribing to `Event`
 
-
 This function uses `gproc:select/2` to find all properties indicating a subscription.
+
 <a name="notify_single_if_true-4"></a>
 
 ### notify_single_if_true/4 ###
 
-
 <pre><code>
 notify_single_if_true(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>, F::fun(() -&gt; boolean()), Msg::<a href="#type-msg">msg()</a>) -&gt; ok
 </code></pre>
 <br />
 
-
 Create/enable a single subscription for event; notify at once if F() -> true
 
-
 This function is a convenience function, wrapping a single-shot pub/sub around a
 user-provided boolean test. `Msg` should be what the publisher will send later, if the
 immediate test returns `false`.
+
 <a name="publish-3"></a>
 
 ### publish/3 ###
 
-
 <pre><code>
 publish(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>, Msg::<a href="#type-msg">msg()</a>) -&gt; ok
 </code></pre>
 <br />
 
-
 Publish the message `Msg` to all subscribers of `Event`
 
-
-
 The message delivered to each subscriber will be of the form:
 
-
-
 `{gproc_ps_event, Event, Msg}`
 
-
 The function uses `gproc:send/2` to send a message to all processes which have a
 property `{p,Scope,{gproc_ps_event,Event}}`.
+
 <a name="publish_cond-3"></a>
 
 ### publish_cond/3 ###
 
-
 <pre><code>
 publish_cond(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>, Msg::<a href="#type-msg">msg()</a>) -&gt; <a href="#type-msg">msg()</a>
 </code></pre>
 <br />
 
-
 Publishes the message `Msg` to conditional subscribers of `Event`
 
-
 The message will be delivered to each subscriber provided their respective
 condition tests succeed.
 
-
 __See also:__ [subscribe_cond/3](#subscribe_cond-3).
+
 <a name="subscribe-2"></a>
 
 ### subscribe/2 ###
 
-
 <pre><code>
 subscribe(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>) -&gt; true
 </code></pre>
 <br />
 
-
 Subscribe to events of type `Event`
 
-
-
 Any messages published with `gproc_ps:publish(Scope, Event, Msg)` will be
 delivered to the current process, along with all other subscribers.
 
-
-
 This function creates a property, `{p,Scope,{gproc_ps_event,Event}}`, which
 can be searched and displayed for debugging purposes.
 
-
 Note that, as with [`gproc:reg/1`](gproc.md#reg-1), this function will raise an
 exception if you try to subscribe to the same event twice from the same
 process.
+
 <a name="subscribe_cond-3"></a>
 
 ### subscribe_cond/3 ###
 
-
 <pre><code>
 subscribe_cond(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>, Spec::undefined | <a href="ets.md#type-match_spec">ets:match_spec()</a>) -&gt; true
 </code></pre>
 <br />
 
-
 Subscribe conditionally to events of type `Event`
 
-
-
 This function is similar to [`subscribe/2`](#subscribe-2), but adds a condition
 in the form of a match specification.
 
-
-
 The condition is tested by the [`publish_cond/3`](#publish_cond-3) function
 and a message is delivered only if the condition is true. Specifically,
 the test is:
 
-
-
 `ets:match_spec_run([Msg], ets:match_spec_compile(Cond)) == [true]`
 
-
-
 In other words, if the match_spec returns true for a message, that message
 is sent to the subscriber. For any other result from the match_spec, the
 message is not sent. `Cond == undefined` means that all messages will be
@@ -366,30 +301,24 @@ like [`publish/3`](#publish-3) does, except that `publish/3` strictly speaking
 ignores the Value part of the property completely, whereas `publish_cond/3`
 expects it to be either undefined or a valid match spec).
 
-
-
 This means that `Cond=undefined` and `Cond=[{'_',[],[true]}]` are
 equivalent.
 
-
 Note that, as with [`gproc:reg/1`](gproc.md#reg-1), this function will raise an
 exception if you try to subscribe to the same event twice from the same
 process.
+
 <a name="tell_singles-3"></a>
 
 ### tell_singles/3 ###
 
-
 <pre><code>
 tell_singles(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>, Msg::<a href="#type-msg">msg()</a>) -&gt; [pid()]
 </code></pre>
 <br />
 
-
 Publish `Msg` to all single-shot subscribers of `Event`
 
-
-
 The subscriber status of each active subscriber is changed to `0` (disabled) before
 delivering the message. This reduces the risk that two different processes will be able
 to both deliver a message before disabling the subscribers. This could happen if the
@@ -397,21 +326,19 @@ context switch happens just after the select operation (finding the active subsc
 and before the process is able to update the counters. In this case, it is possible
 that more than one can be delivered.
 
-
 The way to prevent this from happening is to ensure that only one process publishes
 for `Event`.
+
 <a name="unsubscribe-2"></a>
 
 ### unsubscribe/2 ###
 
-
 <pre><code>
 unsubscribe(Scope::<a href="#type-scope">scope()</a>, Event::<a href="#type-event">event()</a>) -&gt; true
 </code></pre>
 <br />
 
-
 Remove subscribtion created using `subscribe(Scope, Event)`
 
-
 This removes the property created through `subscribe/2`.
+

+ 2 - 9
doc/gproc_pt.md

@@ -5,34 +5,28 @@
 * [Function Index](#index)
 * [Function Details](#functions)
 
-
 Parse transform utility for gproc users.
+
 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)), Dmitry Demeshchuk ([`demeshchuk@gmail.com`](mailto:demeshchuk@gmail.com)).
+
 <a name="description"></a>
 
 ## Description ##
 
-
-
 This module provides some closer syntactical integration for
 people who are enthusiastic gproc users.
 
-
-
 Specifically, this module transforms `Pid ! Msg` into
 `gproc:send(Pid, Msg)`, which, apart from accepting any type for
 `Pid` that `!` understands, is also able to handle a gproc "triple",
 e.g. `{n, l, Name}` or even `{p, l, Prop}` (in the latter case, the
 message may be delivered to multiple recipients).
 
-
-
 Users should be aware that parse transforms may be confusing to
 the casual reader, since they extend the semantics of possibly
 ubiquitous constructs (as is the case with this transform). Therefore,
 you should document clearly that this is happening.
 
-
 Original suggestion by Dimitry Demeschuk.<a name="index"></a>
 
 ## Function Index ##
@@ -51,4 +45,3 @@ Original suggestion by Dimitry Demeschuk.<a name="index"></a>
 
 `parse_transform(Forms, Options) -> any()`
 
-

+ 2 - 1
doc/gproc_sup.md

@@ -5,6 +5,7 @@
 * [Function Details](#functions)
 
 __Behaviours:__ [`supervisor`](supervisor.md).
+
 <a name="index"></a>
 
 ## Function Index ##
@@ -24,10 +25,10 @@ __Behaviours:__ [`supervisor`](supervisor.md).
 `init(Args) -> any()`
 
 The main GPROC supervisor.
+
 <a name="start_link-1"></a>
 
 ### start_link/1 ###
 
 `start_link(Args) -> any()`
 
-