Skip to content

Commit 05cd9f8

Browse files
committed
Added attributes, update_counter() on names, gproc_pool
1 parent 81ff4ce commit 05cd9f8

20 files changed

+2969
-681
lines changed

README.md

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11

22

3-
#The gproc application#
4-
3+
# The gproc application #
54

65
__Authors:__ Ulf Wiger ([`[email protected]`](mailto:[email protected])), Joseph Wayne Norton ([`[email protected]`](mailto:[email protected])).
76

87
Extended process dictionary
98

10-
##Note##
119

10+
## Note ##
1211

1312
Gproc has two dependencies: `gen_leader` and `edown`. Since most people don't
1413
actively use either, they are no longer fetched by default.
14+
1515
* To enable fetching of `gen_leader`, export the OS environment variable`GPROC_DIST=true` (this can be done e.g. from a GNU Makefile)
1616

1717
* `edown` is fetched on-demand whenver `rebar get-deps doc` is called (which
1818
happens when you call `make doc`)
1919

2020

2121

22-
##Introduction##
23-
22+
## Introduction ##
2423

2524
Gproc is a process dictionary for Erlang, which provides a number of useful features beyond what the built-in dictionary has:
25+
2626
* Use any term as a process alias
2727

2828
* Register a process under several aliases
@@ -43,31 +43,34 @@ Gproc is a process dictionary for Erlang, which provides a number of useful feat
4343

4444

4545

46-
###Use case: System inspection##
47-
46+
### Use case: System inspection ###
4847

4948
Gproc was designed to work as a central index for "process metadata", i.e.
5049
properties that describe the role and characteristics of each process. Having
5150
a single registry that is flexible enough to hold important types of property
5251
makes it easier to (a) find processes of a certain type, and (b) query and
5352
browse key data in a running system.
5453

55-
###Use case: Pub/Sub patterns##
5654

55+
### Use case: Pub/Sub patterns ###
5756

5857
An interesting application of gproc is building publish/subscribe patterns.
59-
Example:<pre>
58+
Example:
59+
60+
```erlang
61+
6062
subscribe(EventType) ->
6163
%% Gproc notation: {p, l, Name} means {(p)roperty, (l)ocal, Name}
6264
gproc:reg({p, l, {?MODULE, EventType}}).
6365

6466
notify(EventType, Msg) ->
6567
Key = {?MODULE, EventType},
6668
gproc:send({p, l, Key}, {self(), Key, Msg}).
67-
</pre>
6869

69-
###Use case: Environment handling##
70+
```
71+
7072

73+
### Use case: Environment handling ###
7174

7275
Gproc provides a set of functions to read environment variables, possibly from
7376
alternative sources, and cache them for efficient lookup. Caching also provides
@@ -77,8 +80,8 @@ which values they actually ended up using.
7780
See [`gproc:get_env/4`](https://github.com/esl/gproc/blob/master/doc/gproc.md#get_env-4), [`gproc:get_set_env/4`](https://github.com/esl/gproc/blob/master/doc/gproc.md#get_set_env-4) and
7881
[`gproc:set_env/5`](https://github.com/esl/gproc/blob/master/doc/gproc.md#set_env-5) for details.
7982

80-
##Testing##
8183

84+
## Testing ##
8285

8386
Gproc has a QuickCheck test suite, covering a fairly large part of the local
8487
gproc functionality, although none of the global registry. It requires a
@@ -88,16 +91,17 @@ available, and if it isn't, the code in gproc_eqc.erl will be "defined away".
8891
There is also an eunit suite, covering the basic operations for local and
8992
global gproc.
9093

91-
##Building Edoc##
9294

95+
## Building Edoc ##
9396

9497

9598
By default, `./rebar doc` generates Github-flavored Markdown files.
96-
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
99+
If you want to change this, remove the `edoc_opts` line from `rebar.config`.
100+
Gproc was first introduced at the ACM SIGPLAN Erlang Workshop in
97101
Freiburg 2007 ([Paper available here](https://github.com/esl/gproc/blob/master/doc/erlang07-wiger.pdf)).
98102

99103

100-
##Modules##
104+
## Modules ##
101105

102106

103107
<table width="100%" border="0" summary="list of modules">
@@ -109,6 +113,7 @@ Freiburg 2007 ([Paper available here](https://github.com/esl/gproc/blob/master/do
109113
<tr><td><a href="https://github.com/esl/gproc/blob/master/doc/gproc_init.md" class="module">gproc_init</a></td></tr>
110114
<tr><td><a href="https://github.com/esl/gproc/blob/master/doc/gproc_lib.md" class="module">gproc_lib</a></td></tr>
111115
<tr><td><a href="https://github.com/esl/gproc/blob/master/doc/gproc_monitor.md" class="module">gproc_monitor</a></td></tr>
116+
<tr><td><a href="https://github.com/esl/gproc/blob/master/doc/gproc_pool.md" class="module">gproc_pool</a></td></tr>
112117
<tr><td><a href="https://github.com/esl/gproc/blob/master/doc/gproc_ps.md" class="module">gproc_ps</a></td></tr>
113118
<tr><td><a href="https://github.com/esl/gproc/blob/master/doc/gproc_sup.md" class="module">gproc_sup</a></td></tr></table>
114119

doc/README.md

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11

22

3-
#The gproc application#
4-
3+
# The gproc application #
54

65
__Authors:__ Ulf Wiger ([`[email protected]`](mailto:[email protected])), Joseph Wayne Norton ([`[email protected]`](mailto:[email protected])).
76

87
Extended process dictionary
98

10-
##Note##
119

10+
## Note ##
1211

1312
Gproc has two dependencies: `gen_leader` and `edown`. Since most people don't
1413
actively use either, they are no longer fetched by default.
14+
1515
* To enable fetching of `gen_leader`, export the OS environment variable`GPROC_DIST=true` (this can be done e.g. from a GNU Makefile)
1616

1717
* `edown` is fetched on-demand whenver `rebar get-deps doc` is called (which
1818
happens when you call `make doc`)
1919

2020

2121

22-
##Introduction##
23-
22+
## Introduction ##
2423

2524
Gproc is a process dictionary for Erlang, which provides a number of useful features beyond what the built-in dictionary has:
25+
2626
* Use any term as a process alias
2727

2828
* Register a process under several aliases
@@ -43,31 +43,34 @@ Gproc is a process dictionary for Erlang, which provides a number of useful feat
4343

4444

4545

46-
###Use case: System inspection##
47-
46+
### Use case: System inspection ###
4847

4948
Gproc was designed to work as a central index for "process metadata", i.e.
5049
properties that describe the role and characteristics of each process. Having
5150
a single registry that is flexible enough to hold important types of property
5251
makes it easier to (a) find processes of a certain type, and (b) query and
5352
browse key data in a running system.
5453

55-
###Use case: Pub/Sub patterns##
5654

55+
### Use case: Pub/Sub patterns ###
5756

5857
An interesting application of gproc is building publish/subscribe patterns.
59-
Example:<pre>
58+
Example:
59+
60+
```erlang
61+
6062
subscribe(EventType) ->
6163
%% Gproc notation: {p, l, Name} means {(p)roperty, (l)ocal, Name}
6264
gproc:reg({p, l, {?MODULE, EventType}}).
6365

6466
notify(EventType, Msg) ->
6567
Key = {?MODULE, EventType},
6668
gproc:send({p, l, Key}, {self(), Key, Msg}).
67-
</pre>
6869

69-
###Use case: Environment handling##
70+
```
71+
7072

73+
### Use case: Environment handling ###
7174

7275
Gproc provides a set of functions to read environment variables, possibly from
7376
alternative sources, and cache them for efficient lookup. Caching also provides
@@ -77,8 +80,8 @@ which values they actually ended up using.
7780
See [`gproc:get_env/4`](gproc.md#get_env-4), [`gproc:get_set_env/4`](gproc.md#get_set_env-4) and
7881
[`gproc:set_env/5`](gproc.md#set_env-5) for details.
7982

80-
##Testing##
8183

84+
## Testing ##
8285

8386
Gproc has a QuickCheck test suite, covering a fairly large part of the local
8487
gproc functionality, although none of the global registry. It requires a
@@ -88,16 +91,17 @@ available, and if it isn't, the code in gproc_eqc.erl will be "defined away".
8891
There is also an eunit suite, covering the basic operations for local and
8992
global gproc.
9093

91-
##Building Edoc##
9294

95+
## Building Edoc ##
9396

9497

9598
By default, `./rebar doc` generates Github-flavored Markdown files.
96-
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
99+
If you want to change this, remove the `edoc_opts` line from `rebar.config`.
100+
Gproc was first introduced at the ACM SIGPLAN Erlang Workshop in
97101
Freiburg 2007 ([Paper available here](erlang07-wiger.pdf)).
98102

99103

100-
##Modules##
104+
## Modules ##
101105

102106

103107
<table width="100%" border="0" summary="list of modules">
@@ -109,6 +113,7 @@ Freiburg 2007 ([Paper available here](erlang07-wiger.pdf)).
109113
<tr><td><a href="gproc_init.md" class="module">gproc_init</a></td></tr>
110114
<tr><td><a href="gproc_lib.md" class="module">gproc_lib</a></td></tr>
111115
<tr><td><a href="gproc_monitor.md" class="module">gproc_monitor</a></td></tr>
116+
<tr><td><a href="gproc_pool.md" class="module">gproc_pool</a></td></tr>
112117
<tr><td><a href="gproc_ps.md" class="module">gproc_ps</a></td></tr>
113118
<tr><td><a href="gproc_sup.md" class="module">gproc_sup</a></td></tr></table>
114119

doc/edoc-info

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{application,gproc}.
22
{packages,[]}.
33
{modules,[gproc,gproc_app,gproc_bcast,gproc_dist,gproc_info,gproc_init,
4-
gproc_lib,gproc_monitor,gproc_ps,gproc_sup]}.
4+
gproc_lib,gproc_monitor,gproc_pool,gproc_ps,gproc_sup]}.

0 commit comments

Comments
 (0)