Skip to content
Newer
Older
100644 1931 lines (993 sloc) 54.8 KB
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1
2
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
3 # Module gproc #
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
4 * [Description](#description)
5 * [Data Types](#types)
6 * [Function Index](#index)
7 * [Function Details](#functions)
023e927 don't call is_process_alive on remote pids (thks sg2342)
Ulf Wiger authored
8
9
efeaf8b @uwiger documentation fixes (esp gproc:select/[1,2])
uwiger authored
10 Extended process registry
669e1b2 added performance tuning options
Ulf Wiger authored
11 This module implements an extended process registry.
023e927 don't call is_process_alive on remote pids (thks sg2342)
Ulf Wiger authored
12 __Behaviours:__ [`gen_server`](gen_server.md).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
13
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
14 __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
15 <a name="description"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
16
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
17 ## Description ##
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
18
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
19
20
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
21 For a detailed description, see
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
22 [erlang07-wiger.pdf](erlang07-wiger.pdf).
23
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
24
25
669e1b2 added performance tuning options
Ulf Wiger authored
26
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
27 ## Tuning Gproc performance ##
669e1b2 added performance tuning options
Ulf Wiger authored
28
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
29
30
669e1b2 added performance tuning options
Ulf Wiger authored
31 Gproc relies on a central server and an ordered-set ets table.
32 Effort is made to perform as much work as possible in the client without
33 sacrificing consistency. A few things can be tuned by setting the following
34 application environment variables in the top application of `gproc`
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
35 (usually `gproc`):
36
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
37
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
38 * `{ets_options, list()}` - Currently, the options `{write_concurrency, F}`
669e1b2 added performance tuning options
Ulf Wiger authored
39 and `{read_concurrency, F}` are allowed. The default is
40 `[{write_concurrency, true}, {read_concurrency, true}]`
41 * `{server_options, list()}` - These will be passed as spawn options when
42 starting the `gproc` and `gproc_dist` servers. Default is `[]`. It is
43 likely that `{priority, high | max}` and/or increasing `min_heap_size`
44 will improve performance.
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
45
b5c9cd2 @uwiger resolve race in gproc:await/2
uwiger authored
46 <a name="types"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
47
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
48 ## Data Types ##
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
49
50
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
51
4ffd1fa added surrender/2
Ulf Wiger authored
52
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
53 ### <a name="type-context">context()</a> ###
4ffd1fa added surrender/2
Ulf Wiger authored
54
55
56
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
57 <pre><code>
58 context() = {<a href="#type-scope">scope()</a>, <a href="#type-type">type()</a>} | <a href="#type-type">type()</a>
59 </code></pre>
60
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
61
4ffd1fa added surrender/2
Ulf Wiger authored
62
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
63 {'all','all'} is the default
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
64
65
66
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
67
68 ### <a name="type-ctr_incr">ctr_incr()</a> ###
69
70
71
72 <pre><code>
73 ctr_incr() = integer()
74 </code></pre>
75
76
77
78
79
80 ### <a name="type-ctr_setval">ctr_setval()</a> ###
81
82
83
84 <pre><code>
85 ctr_setval() = integer()
86 </code></pre>
87
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
88
89
90
91
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
92 ### <a name="type-ctr_thr">ctr_thr()</a> ###
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
93
94
95
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
96 <pre><code>
97 ctr_thr() = integer()
98 </code></pre>
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
99
100
101
102
103
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
104 ### <a name="type-ctr_update">ctr_update()</a> ###
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
105
106
107
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
108 <pre><code>
109 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>}
110 </code></pre>
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
111
112
113
114
115
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
116 ### <a name="type-headpat">headpat()</a> ###
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
117
118
119
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
120 <pre><code>
121 headpat() = {<a href="#type-keypat">keypat()</a>, <a href="#type-pidpat">pidpat()</a>, ValPat}
122 </code></pre>
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
123
4ffd1fa added surrender/2
Ulf Wiger authored
124
125
126
127
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
128 ### <a name="type-increment">increment()</a> ###
4ffd1fa added surrender/2
Ulf Wiger authored
129
130
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
131
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
132 <pre><code>
133 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>]
134 </code></pre>
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
135
136
137
138
139
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
140 ### <a name="type-key">key()</a> ###
4ffd1fa added surrender/2
Ulf Wiger authored
141
142
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
143
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
144 <pre><code>
145 key() = {<a href="#type-type">type()</a>, <a href="#type-scope">scope()</a>, any()}
146 </code></pre>
147
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
148
149
1740e41 @uwiger Fix dist update_counter() bug, add gproc_ps module, add update_counte…
uwiger authored
150 update_counter increment
151
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
152
153
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
154 ### <a name="type-keypat">keypat()</a> ###
155
156
157
158 <pre><code>
159 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()}
160 </code></pre>
161
162
163
164
165
b8809f5 @uwiger add monitor(Key, follow), bug fixes for standby
uwiger authored
166 ### <a name="type-monitor_type">monitor_type()</a> ###
167
168
169
170 <pre><code>
171 monitor_type() = info | standby | follow
172 </code></pre>
173
174
175
176
177
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
178 ### <a name="type-pidpat">pidpat()</a> ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
179
180
181
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
182 <pre><code>
183 pidpat() = pid() | <a href="#type-sel_var">sel_var()</a>
184 </code></pre>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
185
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
186
4ffd1fa added surrender/2
Ulf Wiger authored
187
188
189
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
190 ### <a name="type-reg_id">reg_id()</a> ###
4ffd1fa added surrender/2
Ulf Wiger authored
191
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
192
193
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
194 <pre><code>
195 reg_id() = {<a href="#type-type">type()</a>, <a href="#type-scope">scope()</a>, any()}
196 </code></pre>
4ffd1fa added surrender/2
Ulf Wiger authored
197
198
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
199
200
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
201
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
202 ### <a name="type-scope">scope()</a> ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
203
204
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
205
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
206 <pre><code>
207 scope() = l | g
208 </code></pre>
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
209
210
211
212 l = local registration; g = global registration
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
213
214
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
215
4ffd1fa added surrender/2
Ulf Wiger authored
216
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
217 ### <a name="type-sel_pattern">sel_pattern()</a> ###
218
219
220
221 <pre><code>
222 sel_pattern() = [{<a href="#type-headpat">headpat()</a>, Guards, Prod}]
223 </code></pre>
224
225
226
227
228
229 ### <a name="type-sel_scope">sel_scope()</a> ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
230
231
232
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
233 <pre><code>
234 sel_scope() = scope | all | global | local
235 </code></pre>
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
236
237
238
239
240
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
241 ### <a name="type-sel_type">sel_type()</a> ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
242
243
244
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
245 <pre><code>
246 sel_type() = <a href="#type-type">type()</a> | names | props | counters | aggr_counters
247 </code></pre>
4ffd1fa added surrender/2
Ulf Wiger authored
248
249
250
251
252
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
253 ### <a name="type-sel_var">sel_var()</a> ###
4ffd1fa added surrender/2
Ulf Wiger authored
254
839a7a8 @uwiger bad edoc type annotation of sel_var()
uwiger authored
255
256
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
257 <pre><code>
258 sel_var() = DollarVar | '_'
259 </code></pre>
839a7a8 @uwiger bad edoc type annotation of sel_var()
uwiger authored
260
261
262
263
4ffd1fa added surrender/2
Ulf Wiger authored
264
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
265 ### <a name="type-type">type()</a> ###
4ffd1fa added surrender/2
Ulf Wiger authored
266
267
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
268
269 <pre><code>
270 type() = n | p | c | a
271 </code></pre>
272
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
273
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
274
275 n = name; p = property; c = counter;
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
276 a = aggregate_counter
277
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
278
279
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
280 ### <a name="type-unique_id">unique_id()</a> ###
281
282
283
284 <pre><code>
285 unique_id() = {n | a, <a href="#type-scope">scope()</a>, any()}
286 </code></pre>
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
287
288
b5c9cd2 @uwiger resolve race in gproc:await/2
uwiger authored
289 <a name="index"></a>
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
290
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
291 ## Function Index ##
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
292
293
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
294 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#add_global_aggr_counter-1">add_global_aggr_counter/1</a></td><td>Registers a global (unique) aggregated counter.</td></tr><tr><td valign="top"><a href="#add_global_counter-2">add_global_counter/2</a></td><td>Registers a global (non-unique) counter.</td></tr><tr><td valign="top"><a href="#add_global_name-1">add_global_name/1</a></td><td>Registers a global (unique) name.</td></tr><tr><td valign="top"><a href="#add_global_property-2">add_global_property/2</a></td><td>Registers a global (non-unique) property.</td></tr><tr><td valign="top"><a href="#add_local_aggr_counter-1">add_local_aggr_counter/1</a></td><td>Registers a local (unique) aggregated counter.</td></tr><tr><td valign="top"><a href="#add_local_counter-2">add_local_counter/2</a></td><td>Registers a local (non-unique) counter.</td></tr><tr><td valign="top"><a href="#add_local_name-1">add_local_name/1</a></td><td>Registers a local (unique) name.</td></tr><tr><td valign="top"><a href="#add_local_property-2">add_local_property/2</a></td><td>Registers a local (non-unique) property.</td></tr><tr><td valign="top"><a href="#add_shared_local_counter-2">add_shared_local_counter/2</a></td><td>Registers a local shared (unique) counter.</td></tr><tr><td valign="top"><a href="#audit_process-1">audit_process/1</a></td><td></td></tr><tr><td valign="top"><a href="#await-1">await/1</a></td><td>Equivalent to <a href="#await-2"><tt>await(Key, infinity)</tt></a>.</td></tr><tr><td valign="top"><a href="#await-2">await/2</a></td><td>Wait for a local name to be registered.</td></tr><tr><td valign="top"><a href="#await-3">await/3</a></td><td>Wait for a local name to be registered on <code>Node</code>.</td></tr><tr><td valign="top"><a href="#bcast-2">bcast/2</a></td><td>Equivalent to <a href="#bcast-3"><tt>bcast(nodes(), Key, Msg)</tt></a>.</td></tr><tr><td valign="top"><a href="#bcast-3">bcast/3</a></td><td>Sends a message to processes corresponding to Key on Nodes.</td></tr><tr><td valign="top"><a href="#cancel_wait-2">cancel_wait/2</a></td><td>Cancels a previous call to nb_wait/1.</td></tr><tr><td valign="top"><a href="#cancel_wait-3">cancel_wait/3</a></td><td>Cancels a previous call to nb_wait/2.</td></tr><tr><td valign="top"><a href="#cancel_wait_or_monitor-1">cancel_wait_or_monitor/1</a></td><td></td></tr><tr><td valign="top"><a href="#default-1">default/1</a></td><td></td></tr><tr><td valign="top"><a href="#demonitor-2">demonitor/2</a></td><td>Remove a monitor on a registered name
a4190c6 @uwiger gproc_dist:set_value_shared/2
uwiger authored
295 This function is the reverse of monitor/1.</td></tr><tr><td valign="top"><a href="#first-1">first/1</a></td><td>Behaves as ets:first(Tab) for a given type of registration.</td></tr><tr><td valign="top"><a href="#get_attribute-2">get_attribute/2</a></td><td>Get attribute value of <code>Attr</code> associated with <code>Key</code> for most likely Pid.</td></tr><tr><td valign="top"><a href="#get_attribute-3">get_attribute/3</a></td><td>Get the attribute value of <code>Attr</code> associated with <code>Key</code> for process Pid.</td></tr><tr><td valign="top"><a href="#get_attribute_shared-2">get_attribute_shared/2</a></td><td>Get the attribute value of <code>Attr</code> associated with the shared <code>Key</code>.</td></tr><tr><td valign="top"><a href="#get_attributes-1">get_attributes/1</a></td><td>Get attributes associated with registration.</td></tr><tr><td valign="top"><a href="#get_attributes-2">get_attributes/2</a></td><td>Returns the list of attributes associated with the registration.</td></tr><tr><td valign="top"><a href="#get_env-3">get_env/3</a></td><td>Equivalent to <a href="#get_env-4"><tt>get_env(Scope, App, Key, [app_env])</tt></a>.</td></tr><tr><td valign="top"><a href="#get_env-4">get_env/4</a></td><td>Read an environment value, potentially cached as a <code>gproc_env</code> property.</td></tr><tr><td valign="top"><a href="#get_set_env-3">get_set_env/3</a></td><td>Equivalent to <a href="#get_set_env-4"><tt>get_set_env(Scope, App, Key, [app_env])</tt></a>.</td></tr><tr><td valign="top"><a href="#get_set_env-4">get_set_env/4</a></td><td>Fetch and cache an environment value, if not already cached.</td></tr><tr><td valign="top"><a href="#get_value-1">get_value/1</a></td><td>Reads the value stored with a key registered to the current process.</td></tr><tr><td valign="top"><a href="#get_value-2">get_value/2</a></td><td>Reads the value stored with a key registered to the process Pid.</td></tr><tr><td valign="top"><a href="#get_value_shared-1">get_value_shared/1</a></td><td>Reads the value stored with a shared key.</td></tr><tr><td valign="top"><a href="#give_away-2">give_away/2</a></td><td>Atomically transfers the key <code>From</code> to the process identified by <code>To</code>.</td></tr><tr><td valign="top"><a href="#goodbye-0">goodbye/0</a></td><td>Unregister all items of the calling process and inform gproc
b1589f6 Add gproc:i()
Ulf Wiger authored
296 to forget about the calling process.</td></tr><tr><td valign="top"><a href="#i-0">i/0</a></td><td>Similar to the built-in shell command <code>i()</code> but inserts information
41fe220 @uwiger first impl. of standby monitors
uwiger authored
297 about names and properties registered in Gproc, where applicable.</td></tr><tr><td valign="top"><a href="#info-1">info/1</a></td><td>Similar to <code>process_info(Pid)</code> but with additional gproc info.</td></tr><tr><td valign="top"><a href="#info-2">info/2</a></td><td>Similar to process_info(Pid, Item), but with additional gproc info.</td></tr><tr><td valign="top"><a href="#last-1">last/1</a></td><td>Behaves as ets:last(Tab) for a given type of registration.</td></tr><tr><td valign="top"><a href="#lookup_global_aggr_counter-1">lookup_global_aggr_counter/1</a></td><td>Lookup a global (unique) aggregated counter and returns its value.</td></tr><tr><td valign="top"><a href="#lookup_global_counters-1">lookup_global_counters/1</a></td><td>Look up all global (non-unique) instances of a given Counter.</td></tr><tr><td valign="top"><a href="#lookup_global_name-1">lookup_global_name/1</a></td><td>Lookup a global unique name.</td></tr><tr><td valign="top"><a href="#lookup_global_properties-1">lookup_global_properties/1</a></td><td>Look up all global (non-unique) instances of a given Property.</td></tr><tr><td valign="top"><a href="#lookup_local_aggr_counter-1">lookup_local_aggr_counter/1</a></td><td>Lookup a local (unique) aggregated counter and returns its value.</td></tr><tr><td valign="top"><a href="#lookup_local_counters-1">lookup_local_counters/1</a></td><td>Look up all local (non-unique) instances of a given Counter.</td></tr><tr><td valign="top"><a href="#lookup_local_name-1">lookup_local_name/1</a></td><td>Lookup a local unique name.</td></tr><tr><td valign="top"><a href="#lookup_local_properties-1">lookup_local_properties/1</a></td><td>Look up all local (non-unique) instances of a given Property.</td></tr><tr><td valign="top"><a href="#lookup_pid-1">lookup_pid/1</a></td><td>Lookup the Pid stored with a key.</td></tr><tr><td valign="top"><a href="#lookup_pids-1">lookup_pids/1</a></td><td>Returns a list of pids with the published key Key.</td></tr><tr><td valign="top"><a href="#lookup_value-1">lookup_value/1</a></td><td>Lookup the value stored with a key.</td></tr><tr><td valign="top"><a href="#lookup_values-1">lookup_values/1</a></td><td>Retrieve the <code>{Pid,Value}</code> pairs corresponding to Key.</td></tr><tr><td valign="top"><a href="#monitor-1">monitor/1</a></td><td>Equivalent to <a href="#monitor-2"><tt>monitor(Key, info)</tt></a>.</td></tr><tr><td valign="top"><a href="#monitor-2">monitor/2</a></td><td>monitor a registered name
298 <code>monitor(Key, info)</code> works much like erlang:monitor(process, Pid), but monitors
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
299 a unique name registered via gproc.</td></tr><tr><td valign="top"><a href="#mreg-3">mreg/3</a></td><td>Register multiple {Key,Value} pairs of a given type and scope.</td></tr><tr><td valign="top"><a href="#munreg-3">munreg/3</a></td><td>Unregister multiple Key items of a given type and scope.</td></tr><tr><td valign="top"><a href="#nb_wait-1">nb_wait/1</a></td><td>Wait for a local name to be registered.</td></tr><tr><td valign="top"><a href="#nb_wait-2">nb_wait/2</a></td><td>Wait for a local name to be registered on <code>Node</code>.</td></tr><tr><td valign="top"><a href="#next-2">next/2</a></td><td>Behaves as ets:next(Tab,Key) for a given type of registration.</td></tr><tr><td valign="top"><a href="#prev-2">prev/2</a></td><td>Behaves as ets:prev(Tab,Key) for a given type of registration.</td></tr><tr><td valign="top"><a href="#reg-1">reg/1</a></td><td>Equivalent to <a href="#reg-2"><tt>reg(Key, default(Key))</tt></a>.</td></tr><tr><td valign="top"><a href="#reg-2">reg/2</a></td><td>Register a name or property for the current process.</td></tr><tr><td valign="top"><a href="#reg_or_locate-1">reg_or_locate/1</a></td><td>Equivalent to <a href="#reg_or_locate-2"><tt>reg_or_locate(Key, default(Key))</tt></a>.</td></tr><tr><td valign="top"><a href="#reg_or_locate-2">reg_or_locate/2</a></td><td>Try registering a unique name, or return existing registration.</td></tr><tr><td valign="top"><a href="#reg_or_locate-3">reg_or_locate/3</a></td><td>Spawn a process with a registered name, or return existing registration.</td></tr><tr><td valign="top"><a href="#reg_shared-1">reg_shared/1</a></td><td>Register a resource, but don't tie it to a particular process.</td></tr><tr><td valign="top"><a href="#reg_shared-2">reg_shared/2</a></td><td>Register a resource, but don't tie it to a particular process.</td></tr><tr><td valign="top"><a href="#register_name-2">register_name/2</a></td><td>Behaviour support callback.</td></tr><tr><td valign="top"><a href="#reset_counter-1">reset_counter/1</a></td><td>Reads and resets a counter in a "thread-safe" way.</td></tr><tr><td valign="top"><a href="#select-1">select/1</a></td><td>Perform a select operation on the process registry.</td></tr><tr><td valign="top"><a href="#select-2">select/2</a></td><td>Perform a select operation with limited context on the process registry.</td></tr><tr><td valign="top"><a href="#select-3">select/3</a></td><td>Like <a href="#select-2"><code>select/2</code></a> but returns Limit objects at a time.</td></tr><tr><td valign="top"><a href="#select_count-1">select_count/1</a></td><td>Equivalent to <a href="#select_count-2"><tt>select_count(all, Pat)</tt></a>.</td></tr><tr><td valign="top"><a href="#select_count-2">select_count/2</a></td><td>Perform a select_count operation on the process registry.</td></tr><tr><td valign="top"><a href="#send-2">send/2</a></td><td>Sends a message to the process, or processes, corresponding to Key.</td></tr><tr><td valign="top"><a href="#set_attributes-2">set_attributes/2</a></td><td>Add/modify <code>{Key, Value}</code> attributes associated with a registration.</td></tr><tr><td valign="top"><a href="#set_attributes_shared-2">set_attributes_shared/2</a></td><td>Add/modify <code>{Key, Value}</code> attributes associated with a shared registration.</td></tr><tr><td valign="top"><a href="#set_env-5">set_env/5</a></td><td>Updates the cached value as well as underlying environment.</td></tr><tr><td valign="top"><a href="#set_value-2">set_value/2</a></td><td>Sets the value of the registration given by Key.</td></tr><tr><td valign="top"><a href="#set_value_shared-2">set_value_shared/2</a></td><td>Sets the value of the shared registration given by Key.</td></tr><tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td>Starts the gproc server.</td></tr><tr><td valign="top"><a href="#table-0">table/0</a></td><td>Equivalent to <a href="#table-1"><tt>table({all, all})</tt></a>.</td></tr><tr><td valign="top"><a href="#table-1">table/1</a></td><td>Equivalent to <a href="#table-2"><tt>table(Context, [])</tt></a>.</td></tr><tr><td valign="top"><a href="#table-2">table/2</a></td><td>QLC table generator for the gproc registry.</td></tr><tr><td valign="top"><a href="#unreg-1">unreg/1</a></td><td>Unregister a name or property.</td></tr><tr><td valign="top"><a href="#unreg_shared-1">unreg_shared/1</a></td><td>Unregister a shared resource.</td></tr><tr><td valign="top"><a href="#unregister_name-1">unregister_name/1</a></td><td>Equivalent to <tt>unreg / 1</tt>.</td></tr><tr><td valign="top"><a href="#update_counter-2">update_counter/2</a></td><td>Updates the counter registered as Key for the current process.</td></tr><tr><td valign="top"><a href="#update_counter-3">update_counter/3</a></td><td></td></tr><tr><td valign="top"><a href="#update_counters-2">update_counters/2</a></td><td>Update a list of counters.</td></tr><tr><td valign="top"><a href="#update_shared_counter-2">update_shared_counter/2</a></td><td>Updates the shared counter registered as Key.</td></tr><tr><td valign="top"><a href="#where-1">where/1</a></td><td>Returns the pid registered as Key.</td></tr><tr><td valign="top"><a href="#whereis_name-1">whereis_name/1</a></td><td>Equivalent to <tt>where / 1</tt>.</td></tr><tr><td valign="top"><a href="#wide_await-3">wide_await/3</a></td><td>Wait for a local name to be registered on any of <code>Nodes</code>.</td></tr></table>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
300
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
301
b5c9cd2 @uwiger resolve race in gproc:await/2
uwiger authored
302 <a name="functions"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
303
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
304 ## Function Details ##
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
305
306 <a name="add_global_aggr_counter-1"></a>
307
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
308 ### add_global_aggr_counter/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
309
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
310 `add_global_aggr_counter(Name) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
311
312 Equivalent to [`reg({a, g, Name})`](#reg-1).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
313
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
314 Registers a global (unique) aggregated counter.
315 <a name="add_global_counter-2"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
316
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
317 ### add_global_counter/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
318
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
319 `add_global_counter(Name, Initial) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
320
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
321 Registers a global (non-unique) counter. @equiv reg({c,g,Name},Value)
322 <a name="add_global_name-1"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
323
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
324 ### add_global_name/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
325
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
326 `add_global_name(Name) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
327
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
328 Registers a global (unique) name. @equiv reg({n,g,Name})
329 <a name="add_global_property-2"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
330
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
331 ### add_global_property/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
332
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
333 `add_global_property(Name, Value) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
334
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
335 Registers a global (non-unique) property. @equiv reg({p,g,Name},Value)
336 <a name="add_local_aggr_counter-1"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
337
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
338 ### add_local_aggr_counter/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
339
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
340 `add_local_aggr_counter(Name) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
341
342 Equivalent to [`reg({a, l, Name})`](#reg-1).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
343
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
344 Registers a local (unique) aggregated counter.
345 <a name="add_local_counter-2"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
346
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
347 ### add_local_counter/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
348
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
349 `add_local_counter(Name, Initial) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
350
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
351 Registers a local (non-unique) counter. @equiv reg({c,l,Name},Value)
352 <a name="add_local_name-1"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
353
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
354 ### add_local_name/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
355
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
356 `add_local_name(Name) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
357
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
358 Registers a local (unique) name. @equiv reg({n,l,Name})
359 <a name="add_local_property-2"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
360
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
361 ### add_local_property/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
362
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
363 `add_local_property(Name, Value) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
364
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
365 Registers a local (non-unique) property. @equiv reg({p,l,Name},Value)
366 <a name="add_shared_local_counter-2"></a>
8c1e685 shared counters; reset_counter
Ulf Wiger authored
367
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
368 ### add_shared_local_counter/2 ###
8c1e685 shared counters; reset_counter
Ulf Wiger authored
369
370 `add_shared_local_counter(Name, Initial) -> any()`
371
372 Equivalent to [`reg_shared({c, l, Name}, Value)`](#reg_shared-2).
373
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
374 Registers a local shared (unique) counter.
375 <a name="audit_process-1"></a>
376
377 ### audit_process/1 ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
378
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
379
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
380 <pre><code>
381 audit_process(Pid::pid()) -&gt; ok
382 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
383
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
384 <br></br>
385
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
386
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
387
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
388 <a name="await-1"></a>
389
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
390 ### await/1 ###
391
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
392
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
393 <pre><code>
394 await(Key::<a href="#type-key">key()</a>) -&gt; {pid(), Value}
395 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
396
4ffd1fa added surrender/2
Ulf Wiger authored
397 <br></br>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
398
399
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
400 Equivalent to [`await(Key, infinity)`](#await-2).
401 <a name="await-2"></a>
4ffd1fa added surrender/2
Ulf Wiger authored
402
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
403 ### await/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
404
405
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
406 <pre><code>
407 await(Key::<a href="#type-key">key()</a>, Timeout) -&gt; {pid(), Value}
408 </code></pre>
409
410 <ul class="definitions"><li><code>Timeout = integer() | infinity</code></li></ul>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
411
412 Wait for a local name to be registered.
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
413 The function raises an exception if the timeout expires. Timeout must be
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
414 either an interger > 0 or 'infinity'.
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
415 A small optimization: we first perform a lookup, to see if the name
416 is already registered. This way, the cost of the operation will be
417 roughly the same as of where/1 in the case where the name is already
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
418 registered (the difference: await/2 also returns the value).
419 <a name="await-3"></a>
420
421 ### await/3 ###
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
422
423
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
424 <pre><code>
425 await(Node::node(), Key::<a href="#type-key">key()</a>, Timeout) -&gt; {pid(), Value}
426 </code></pre>
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
427
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
428 <ul class="definitions"><li><code>Timeout = integer() | infinity</code></li></ul>
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
429
430 Wait for a local name to be registered on `Node`.
431 This function works exactly like [`await/2`](#await-2), but queries a remote
432 node instead. An exception is thrown if `Node` cannot be reached. If gproc
433 is not running on a given node, this is treated the same as the node being
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
434 down.
435 <a name="bcast-2"></a>
436
437 ### bcast/2 ###
b374ea6 @uwiger added gproc:bcast/[2,3]
uwiger authored
438
439
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
440 <pre><code>
441 bcast(Key::<a href="#type-key">key()</a>, Msg::any()) -&gt; Msg
442 </code></pre>
b374ea6 @uwiger added gproc:bcast/[2,3]
uwiger authored
443
444 <br></br>
445
446
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
447 Equivalent to [`bcast(nodes(), Key, Msg)`](#bcast-3).
448 <a name="bcast-3"></a>
b374ea6 @uwiger added gproc:bcast/[2,3]
uwiger authored
449
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
450 ### bcast/3 ###
b374ea6 @uwiger added gproc:bcast/[2,3]
uwiger authored
451
452
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
453 <pre><code>
454 bcast(Nodes::[atom()], Key::<a href="#type-key">key()</a>, Msg::any()) -&gt; Msg
455 </code></pre>
b374ea6 @uwiger added gproc:bcast/[2,3]
uwiger authored
456
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
457 <br></br>
b374ea6 @uwiger added gproc:bcast/[2,3]
uwiger authored
458
459
460
461 Sends a message to processes corresponding to Key on Nodes.
462
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
463
b374ea6 @uwiger added gproc:bcast/[2,3]
uwiger authored
464 This function complements `send/2` and works on locally registered resources
465 that `send/2` supports. Messages are routed via a special broadcast server
466 on each node to ensure that ordering is preserved. Distributed delivery
467 is asynchronous and carries the same guarantees as normal message passing
468 (with the added proviso that the broadcast server also needs to be available).
469
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
470 __See also:__ [send/2](#send-2).
471 <a name="cancel_wait-2"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
472
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
473 ### cancel_wait/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
474
475
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
476 <pre><code>
477 cancel_wait(Key::<a href="#type-key">key()</a>, Ref) -&gt; ok
478 </code></pre>
a4d7f6f @uwiger subscription, monitor local,dist + test cases
uwiger authored
479
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
480 <ul class="definitions"><li><code>Ref = all | reference()</code></li></ul>
a4d7f6f @uwiger subscription, monitor local,dist + test cases
uwiger authored
481
482
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
483 Cancels a previous call to nb_wait/1
a4d7f6f @uwiger subscription, monitor local,dist + test cases
uwiger authored
484
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
485
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
486 If `Ref = all`, all wait requests on `Key` from the calling process
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
487 are canceled.
488 <a name="cancel_wait-3"></a>
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
489
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
490 ### cancel_wait/3 ###
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
491
492
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
493 <pre><code>
494 cancel_wait(Node::node(), Key::<a href="#type-key">key()</a>, Ref) -&gt; ok
495 </code></pre>
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
496
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
497 <ul class="definitions"><li><code>Ref = all | reference()</code></li></ul>
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
498
499
500 Cancels a previous call to nb_wait/2
501
a4d7f6f @uwiger subscription, monitor local,dist + test cases
uwiger authored
502
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
503 This function works just like [`cancel_wait/2`](#cancel_wait-2), but talks to a remote
504 node.
505 <a name="cancel_wait_or_monitor-1"></a>
a4d7f6f @uwiger subscription, monitor local,dist + test cases
uwiger authored
506
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
507 ### cancel_wait_or_monitor/1 ###
a4d7f6f @uwiger subscription, monitor local,dist + test cases
uwiger authored
508
509 `cancel_wait_or_monitor(Key) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
510
511
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
512 <a name="default-1"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
513
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
514 ### default/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
515
59365c4 Fixed select/qlc scope (default: all); fixed dist eunit test; new rebar
Ulf Wiger authored
516 `default(X1) -> any()`
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
517
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
518
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
519 <a name="demonitor-2"></a>
520
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
521 ### demonitor/2 ###
522
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
523
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
524 <pre><code>
525 demonitor(Key::<a href="#type-key">key()</a>, Ref::reference()) -&gt; ok
526 </code></pre>
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
527
528 <br></br>
529
530
531 Remove a monitor on a registered name
532 This function is the reverse of monitor/1. It removes a monitor previously
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
533 set on a unique name. This function always succeeds given legal input.
534 <a name="first-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
535
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
536 ### first/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
537
538
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
539 <pre><code>
540 first(Context::<a href="#type-context">context()</a>) -&gt; <a href="#type-key">key()</a> | '$end_of_table'
541 </code></pre>
542
4ffd1fa added surrender/2
Ulf Wiger authored
543 <br></br>
544
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
545
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
546
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
547 Behaves as ets:first(Tab) for a given type of registration.
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
548
549
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
550 See [`http://www.erlang.org/doc/man/ets.html#first-1`](http://www.erlang.org/doc/man/ets.html#first-1).
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
551 The registry behaves as an ordered_set table.
552 <a name="get_attribute-2"></a>
553
554 ### get_attribute/2 ###
555
556
557 <pre><code>
558 get_attribute(Key, Attribute::atom()) -&gt; Value
559 </code></pre>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
560
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
561 <br></br>
562
563
564
565 Get attribute value of `Attr` associated with `Key` for most likely Pid.
566
567
568 The most likely Pid in this case is `self()` for properties and counters,
569 and the current registration holder in case of names or aggregated counters.
570 An exception is raised if `Key` is not registered for the given process.
571 <a name="get_attribute-3"></a>
572
573 ### get_attribute/3 ###
574
575
576 <pre><code>
577 get_attribute(Key, Pid::pid() | shared, Attr::atom()) -&gt; Value
578 </code></pre>
579
580 <br></br>
581
582
583
584 Get the attribute value of `Attr` associated with `Key` for process Pid.
585
586
587 If `Pid == shared`, the attribute of a shared key (see [`reg_shared/1`](#reg_shared-1))
588 will be read.
a4190c6 @uwiger gproc_dist:set_value_shared/2
uwiger authored
589 <a name="get_attribute_shared-2"></a>
590
591 ### get_attribute_shared/2 ###
592
593
594 <pre><code>
595 get_attribute_shared(Key, Attr::atom()) -&gt; Value
596 </code></pre>
597
598 <br></br>
599
600
601
602 Get the attribute value of `Attr` associated with the shared `Key`.
603
604
605 Equivalent to `get_attribute(Key, shared, Attr)`
606 (see [`get_attribute/3`](#get_attribute-3)).
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
607 <a name="get_attributes-1"></a>
608
609 ### get_attributes/1 ###
610
611
612 <pre><code>
613 get_attributes(Key::<a href="#type-key">key()</a>) -&gt; [{K, V}]
614 </code></pre>
615
616 <br></br>
617
618
619 Equivalent to [`get_attributes(Key, self())`](#get_attributes-2).
620
621 Get attributes associated with registration.
622 <a name="get_attributes-2"></a>
623
624 ### get_attributes/2 ###
625
626
627 <pre><code>
628 get_attributes(Key::<a href="#type-key">key()</a>, Pid::pid() | shared) -&gt; [{K, V}]
629 </code></pre>
630
631 <br></br>
632
633
634
635 Returns the list of attributes associated with the registration.
636
637
638 This function raises a `badarg` exception if there is no corresponding
639 registration.
c306076 First implementation of environment variable handling.
Ulf Wiger authored
640
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
641 <a name="get_env-3"></a>
642
643 ### get_env/3 ###
644
645
646 <pre><code>
647 get_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom()) -&gt; term()
648 </code></pre>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
649
650 <br></br>
651
652
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
653 Equivalent to [`get_env(Scope, App, Key, [app_env])`](#get_env-4).
654 <a name="get_env-4"></a>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
655
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
656 ### get_env/4 ###
c306076 First implementation of environment variable handling.
Ulf Wiger authored
657
658
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
659 <pre><code>
660 get_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Strategy) -&gt; term()
661 </code></pre>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
662
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
663 <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>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
664
665
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
666 Read an environment value, potentially cached as a `gproc_env` property.
c306076 First implementation of environment variable handling.
Ulf Wiger authored
667
668
669
670 This function first tries to read the value of a cached property,
671 `{p, Scope, {gproc_env, App, Key}}`. If this fails, it will try the provided
efeaf8b @uwiger documentation fixes (esp gproc:select/[1,2])
uwiger authored
672 alternative strategy. `Strategy` is a list of alternatives, tried in order.
c306076 First implementation of environment variable handling.
Ulf Wiger authored
673 Each alternative can be one of:
674
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
675
676
c306076 First implementation of environment variable handling.
Ulf Wiger authored
677 * `app_env` - try `application:get_env(App, Key)`
678 * `os_env` - try `os:getenv(ENV)`, where `ENV` is `Key` converted into an
679 uppercase string
680 * `{os_env, ENV}` - try `os:getenv(ENV)`
e46cabf fix lines that were too long
Ulf Wiger authored
681 * `inherit` - inherit the cached value, if any, held by the parent process.
c306076 First implementation of environment variable handling.
Ulf Wiger authored
682 * `{inherit, Pid}` - inherit the cached value, if any, held by `Pid`.
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
683 * `{inherit, Id}` - inherit the cached value, if any, held by the process
684 registered in `gproc` as `Id`.
af14ad2 doc additions, inherit by name, init_arg
Ulf Wiger authored
685 * `init_arg` - try `init:get_argument(Key)`; expects a single value, if any.
686 * `{mnesia, ActivityType, Oid, Pos}` - try
e46cabf fix lines that were too long
Ulf Wiger authored
687 `mnesia:activity(ActivityType, fun() -> mnesia:read(Oid) end)`; retrieve
688 the value in position `Pos` if object found.
689 * `{default, Value}` - set a default value to return once alternatives have
690 been exhausted; if not set, `undefined` will be returned.
c306076 First implementation of environment variable handling.
Ulf Wiger authored
691 * `error` - raise an exception, `erlang:error(gproc_env, [App, Key, Scope])`.
692
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
693
694
c306076 First implementation of environment variable handling.
Ulf Wiger authored
695 While any alternative can occur more than once, the only one that might make
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
696 sense to use multiple times is `{default, Value}`.
697
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
698
699
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
700 The return value will be one of:
701
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
702
703
e46cabf fix lines that were too long
Ulf Wiger authored
704 * The value of the first matching alternative, or `error` eception,
f096466 doc fixes + revert to shortnames in dist_tests
Ulf Wiger authored
705 whichever comes first
706 * The last instance of `{default, Value}`, or `undefined`, if there is no
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
707 matching alternative, default or `error` entry in the list.
708
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
709
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
710 The `error` option can be used to assert that a value has been previously
c306076 First implementation of environment variable handling.
Ulf Wiger authored
711 cached. Alternatively, it can be used to assert that a value is either cached
e46cabf fix lines that were too long
Ulf Wiger authored
712 or at least defined somewhere,
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
713 e.g. `get_env(l, mnesia, dir, [app_env, error])`.
714 <a name="get_set_env-3"></a>
715
716 ### get_set_env/3 ###
c306076 First implementation of environment variable handling.
Ulf Wiger authored
717
718
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
719 <pre><code>
720 get_set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom()) -&gt; term()
721 </code></pre>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
722
723 <br></br>
724
725
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
726 Equivalent to [`get_set_env(Scope, App, Key, [app_env])`](#get_set_env-4).
727 <a name="get_set_env-4"></a>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
728
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
729 ### get_set_env/4 ###
c306076 First implementation of environment variable handling.
Ulf Wiger authored
730
731
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
732 <pre><code>
733 get_set_env(Scope::<a href="#type-scope">scope()</a>, App::atom(), Key::atom(), Strategy) -&gt; Value
734 </code></pre>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
735
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
736 <br></br>
c306076 First implementation of environment variable handling.
Ulf Wiger authored
737
738
739
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
740 Fetch and cache an environment value, if not already cached.
c306076 First implementation of environment variable handling.
Ulf Wiger authored
741
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
742
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
743 This function does the same thing as [`get_env/4`](#get_env-4), but also updates the
c306076 First implementation of environment variable handling.
Ulf Wiger authored
744 cache. Note that the cache will be updated even if the result of the lookup
af14ad2 doc additions, inherit by name, init_arg
Ulf Wiger authored
745 is `undefined`.
746
747
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
748 __See also:__ [get_env/4](#get_env-4).
749 <a name="get_value-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
750
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
751 ### get_value/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
752
753
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
754 <pre><code>
755 get_value(Key) -&gt; Value
756 </code></pre>
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
757
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
758 <br></br>
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
759
760
761
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
762 Reads the value stored with a key registered to the current process.
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
763
8c1e685 shared counters; reset_counter
Ulf Wiger authored
764
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
765 If no such key is registered to the current process, this function exits.
766 <a name="get_value-2"></a>
8c1e685 shared counters; reset_counter
Ulf Wiger authored
767
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
768 ### get_value/2 ###
8c1e685 shared counters; reset_counter
Ulf Wiger authored
769
770
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
771 <pre><code>
772 get_value(Key, Pid) -&gt; Value
773 </code></pre>
774
775 <br></br>
8c1e685 shared counters; reset_counter
Ulf Wiger authored
776
777
778
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
779 Reads the value stored with a key registered to the process Pid.
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
780
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
781
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
782 If `Pid == shared`, the value of a shared key (see [`reg_shared/1`](#reg_shared-1))
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
783 will be read.
a4190c6 @uwiger gproc_dist:set_value_shared/2
uwiger authored
784 <a name="get_value_shared-1"></a>
785
786 ### get_value_shared/1 ###
787
788
789 <pre><code>
790 get_value_shared(Key) -&gt; Value
791 </code></pre>
792
793 <br></br>
794
795
796
797 Reads the value stored with a shared key.
798
799
800 If no such shared key is registered, this function exits.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
801 <a name="give_away-2"></a>
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
802
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
803 ### give_away/2 ###
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
804
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
805
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
806 <pre><code>
807 give_away(From::<a href="#type-key">key()</a>, To::pid() | <a href="#type-key">key()</a>) -&gt; undefined | pid()
808 </code></pre>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
809
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
810 <br></br>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
811
812
813
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
814 Atomically transfers the key `From` to the process identified by `To`.
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
815
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
816
4ffd1fa added surrender/2
Ulf Wiger authored
817
efeaf8b @uwiger documentation fixes (esp gproc:select/[1,2])
uwiger authored
818 This function transfers any gproc key (name, property, counter, aggr counter)
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
819 from one process to another, and returns the pid of the new owner.
820
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
821
822
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
823 `To` must be either a pid or a unique name (name or aggregated counter), but
824 does not necessarily have to resolve to an existing process. If there is
825 no process registered with the `To` key, `give_away/2` returns `undefined`,
826 and the `From` key is effectively unregistered.
827
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
828
829
efeaf8b @uwiger documentation fixes (esp gproc:select/[1,2])
uwiger authored
830 It is allowed to give away a key to oneself, but of course, this operation
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
831 will have no effect.
832
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
833
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
834 Fails with `badarg` if the calling process does not have a `From` key
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
835 registered.
836 <a name="goodbye-0"></a>
4dcd33b safer path setting for dist_tests
Ulf Wiger authored
837
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
838 ### goodbye/0 ###
4dcd33b safer path setting for dist_tests
Ulf Wiger authored
839
840
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
841 <pre><code>
842 goodbye() -&gt; ok
843 </code></pre>
4dcd33b safer path setting for dist_tests
Ulf Wiger authored
844
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
845 <br></br>
4dcd33b safer path setting for dist_tests
Ulf Wiger authored
846
847
848
efeaf8b @uwiger documentation fixes (esp gproc:select/[1,2])
uwiger authored
849 Unregister all items of the calling process and inform gproc
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
850 to forget about the calling process.
851
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
852
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
853 This function is more efficient than letting gproc perform these
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
854 cleanup operations.
855 <a name="i-0"></a>
b1589f6 Add gproc:i()
Ulf Wiger authored
856
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
857 ### i/0 ###
b1589f6 Add gproc:i()
Ulf Wiger authored
858
859
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
860 <pre><code>
861 i() -&gt; ok
862 </code></pre>
863
b1589f6 Add gproc:i()
Ulf Wiger authored
864 <br></br>
865
866
867 Similar to the built-in shell command `i()` but inserts information
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
868 about names and properties registered in Gproc, where applicable.
869 <a name="info-1"></a>
2393bf4 Added gproc:give_away/2 and introduced eunit tests for gproc_dist
Ulf Wiger authored
870
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
871 ### info/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
872
873
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
874 <pre><code>
875 info(Pid::pid()) -&gt; ProcessInfo
876 </code></pre>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
877
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
878 <ul class="definitions"><li><code>ProcessInfo = [{gproc, [{Key, Value}]} | ProcessInfo]</code></li></ul>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
879
880
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
881 Similar to `process_info(Pid)` but with additional gproc info.
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
882
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
883
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
884 Returns the same information as process_info(Pid), but with the
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
885 addition of a `gproc` information item, containing the `{Key,Value}`
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
886 pairs registered to the process.
887 <a name="info-2"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
888
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
889 ### info/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
890
891
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
892 <pre><code>
893 info(Pid::pid(), Item::atom()) -&gt; {Item, Info}
894 </code></pre>
4ffd1fa added surrender/2
Ulf Wiger authored
895
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
896 <br></br>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
897
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
898
899
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
900 Similar to process_info(Pid, Item), but with additional gproc info.
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
901
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
902
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
903 For `Item = gproc`, this function returns a list of `{Key, Value}` pairs
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
904 registered to the process Pid. For other values of Item, it returns the
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
905 same as [`http://www.erlang.org/doc/man/erlang.html#process_info-2`](http://www.erlang.org/doc/man/erlang.html#process_info-2).
906 <a name="last-1"></a>
907
908 ### last/1 ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
909
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
910
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
911 <pre><code>
912 last(Context::<a href="#type-context">context()</a>) -&gt; <a href="#type-key">key()</a> | '$end_of_table'
913 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
914
4ffd1fa added surrender/2
Ulf Wiger authored
915 <br></br>
916
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
917
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
918
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
919 Behaves as ets:last(Tab) for a given type of registration.
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
920
921
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
922 See [`http://www.erlang.org/doc/man/ets.html#last-1`](http://www.erlang.org/doc/man/ets.html#last-1).
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
923 The registry behaves as an ordered_set table.
924 <a name="lookup_global_aggr_counter-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
925
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
926 ### lookup_global_aggr_counter/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
927
928
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
929 <pre><code>
930 lookup_global_aggr_counter(Name::any()) -&gt; integer()
931 </code></pre>
932
4ffd1fa added surrender/2
Ulf Wiger authored
933 <br></br>
934
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
935
bf6bc94 @uwiger fixed erratum in doc (#9)
uwiger authored
936 Equivalent to [`lookup_value({a, g, Name})`](#lookup_value-1).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
937
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
938 Lookup a global (unique) aggregated counter and returns its value.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
939 Fails if there is no such object.
940 <a name="lookup_global_counters-1"></a>
941
942 ### lookup_global_counters/1 ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
943
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
944
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
945 <pre><code>
946 lookup_global_counters(Counter::any()) -&gt; [{pid(), Value::integer()}]
947 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
948
4ffd1fa added surrender/2
Ulf Wiger authored
949 <br></br>
950
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
951
952 Equivalent to [`lookup_values({c, g, Counter})`](#lookup_values-1).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
953
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
954 Look up all global (non-unique) instances of a given Counter.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
955 Returns a list of {Pid, Value} tuples for all matching objects.
956 <a name="lookup_global_name-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
957
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
958 ### lookup_global_name/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
959
960
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
961 <pre><code>
962 lookup_global_name(Name::any()) -&gt; pid()
963 </code></pre>
964
4ffd1fa added surrender/2
Ulf Wiger authored
965 <br></br>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
966
967
4ffd1fa added surrender/2
Ulf Wiger authored
968 Equivalent to [`where({n, g, Name})`](#where-1).
969
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
970 Lookup a global unique name. Fails if there is no such name.
971 <a name="lookup_global_properties-1"></a>
972
973 ### lookup_global_properties/1 ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
974
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
975
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
976 <pre><code>
977 lookup_global_properties(Property::any()) -&gt; [{pid(), Value}]
978 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
979
4ffd1fa added surrender/2
Ulf Wiger authored
980 <br></br>
981
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
982
983 Equivalent to [`lookup_values({p, g, Property})`](#lookup_values-1).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
984
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
985 Look up all global (non-unique) instances of a given Property.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
986 Returns a list of {Pid, Value} tuples for all matching objects.
987 <a name="lookup_local_aggr_counter-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
988
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
989 ### lookup_local_aggr_counter/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
990
991
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
992 <pre><code>
993 lookup_local_aggr_counter(Name::any()) -&gt; integer()
994 </code></pre>
995
4ffd1fa added surrender/2
Ulf Wiger authored
996 <br></br>
997
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
998
999 Equivalent to [`where({a, l, Name})`](#where-1).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1000
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1001 Lookup a local (unique) aggregated counter and returns its value.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1002 Fails if there is no such object.
1003 <a name="lookup_local_counters-1"></a>
1004
1005 ### lookup_local_counters/1 ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1006
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1007
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1008 <pre><code>
1009 lookup_local_counters(Counter::any()) -&gt; [{pid(), Value::integer()}]
1010 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1011
4ffd1fa added surrender/2
Ulf Wiger authored
1012 <br></br>
1013
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1014
1015 Equivalent to [`lookup_values({c, l, Counter})`](#lookup_values-1).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1016
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1017 Look up all local (non-unique) instances of a given Counter.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1018 Returns a list of {Pid, Value} tuples for all matching objects.
1019 <a name="lookup_local_name-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1020
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1021 ### lookup_local_name/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1022
1023
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1024 <pre><code>
1025 lookup_local_name(Name::any()) -&gt; pid()
1026 </code></pre>
1027
4ffd1fa added surrender/2
Ulf Wiger authored
1028 <br></br>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1029
1030
4ffd1fa added surrender/2
Ulf Wiger authored
1031 Equivalent to [`where({n, l, Name})`](#where-1).
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1032
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1033 Lookup a local unique name. Fails if there is no such name.
1034 <a name="lookup_local_properties-1"></a>
1035
1036 ### lookup_local_properties/1 ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1037
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1038
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1039 <pre><code>
1040 lookup_local_properties(Property::any()) -&gt; [{pid(), Value}]
1041 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1042
4ffd1fa added surrender/2
Ulf Wiger authored
1043 <br></br>
1044
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1045
1046 Equivalent to [`lookup_values({p, l, Property})`](#lookup_values-1).
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1047
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1048 Look up all local (non-unique) instances of a given Property.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1049 Returns a list of {Pid, Value} tuples for all matching objects.
1050 <a name="lookup_pid-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1051
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1052 ### lookup_pid/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1053
1054
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1055 <pre><code>
1056 lookup_pid(Key) -&gt; Pid
1057 </code></pre>
1058
4ffd1fa added surrender/2
Ulf Wiger authored
1059 <br></br>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1060
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1061
4ffd1fa added surrender/2
Ulf Wiger authored
1062 Lookup the Pid stored with a key.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1063
4ffd1fa added surrender/2
Ulf Wiger authored
1064 <a name="lookup_pids-1"></a>
1065
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1066 ### lookup_pids/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1067
1068
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1069 <pre><code>
1070 lookup_pids(Key::<a href="#type-key">key()</a>) -&gt; [pid()]
1071 </code></pre>
4ffd1fa added surrender/2
Ulf Wiger authored
1072
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1073 <br></br>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1074
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1075
1076
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1077 Returns a list of pids with the published key Key
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1078
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1079
1080
1081 If the type of registration is either name or aggregated counter,
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1082 this function will return either an empty list, or a list of one pid.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1083 For non-unique types, the return value can be a list of any length.
1084
1085
1086 Note: shared resources are not associated with any pid, and will
1087 therefore be excluded.
1088 <a name="lookup_value-1"></a>
1089
1090 ### lookup_value/1 ###
817e578 re-exported lookup_value/1
Ulf Wiger authored
1091
1092
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1093 <pre><code>
1094 lookup_value(Key) -&gt; Value
1095 </code></pre>
817e578 re-exported lookup_value/1
Ulf Wiger authored
1096
4ffd1fa added surrender/2
Ulf Wiger authored
1097 <br></br>
817e578 re-exported lookup_value/1
Ulf Wiger authored
1098
1099
4ffd1fa added surrender/2
Ulf Wiger authored
1100 Lookup the value stored with a key.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1101
4ffd1fa added surrender/2
Ulf Wiger authored
1102 <a name="lookup_values-1"></a>
1103
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1104 ### lookup_values/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1105
1106
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1107 <pre><code>
1108 lookup_values(Key::<a href="#type-key">key()</a>) -&gt; [{pid(), Value}]
1109 </code></pre>
4ffd1fa added surrender/2
Ulf Wiger authored
1110
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1111 <br></br>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1112
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1113
1114
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1115 Retrieve the `{Pid,Value}` pairs corresponding to Key.
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1116
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1117
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1118 Key refer to any type of registry object. If it refers to a unique
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1119 object, the list will be of length 0 or 1. If it refers to a non-unique
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1120 object, the return value can be a list of any length.
1121 <a name="monitor-1"></a>
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
1122
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1123 ### monitor/1 ###
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
1124
41fe220 @uwiger first impl. of standby monitors
uwiger authored
1125 `monitor(Key) -> any()`
1126
1127 Equivalent to [`monitor(Key, info)`](#monitor-2).
1128 <a name="monitor-2"></a>
1129
1130 ### monitor/2 ###
1131
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1132
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1133 <pre><code>
b8809f5 @uwiger add monitor(Key, follow), bug fixes for standby
uwiger authored
1134 monitor(Key::<a href="#type-key">key()</a>, Type::<a href="#type-monitor_type">monitor_type()</a>) -&gt; reference()
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1135 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1136
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1137 <br></br>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1138
1139
1140
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
1141 monitor a registered name
41fe220 @uwiger first impl. of standby monitors
uwiger authored
1142 `monitor(Key, info)` works much like erlang:monitor(process, Pid), but monitors
efeaf8b @uwiger documentation fixes (esp gproc:select/[1,2])
uwiger authored
1143 a unique name registered via gproc. A message, `{gproc, unreg, Ref, Key}`
1144 will be sent to the requesting process, if the name is unregistered or
41fe220 @uwiger first impl. of standby monitors
uwiger authored
1145 the registered process dies. If there is a standby monitor (see below), a
1146 message `{gproc, {failover, ToPid}, Ref, Key}` is sent to all monitors.
1147 If the name is passed to another process using [`give_away/2`](#give_away-2), the event
1148 `{gproc, {migrated, ToPid}, Ref, Key}` is sent to all monitors.
1149
1150
1151
1152 `monitor(Key, standby)` sets up the monitoring process as a standby for the
1153 registered name. If the registered process dies, the first standby process
1154 inherits the name, and a message `{gproc, {failover, ToPid}, Ref, Key}` is
1155 sent to all monitors, including the one that inherited the name.
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1156
1157
b8809f5 @uwiger add monitor(Key, follow), bug fixes for standby
uwiger authored
1158
41fe220 @uwiger first impl. of standby monitors
uwiger authored
1159 If the name is not yet registered, the unreg event is sent immediately.
1160 If the calling process in this case tried to start a `standby` monitoring,
1161 it receives the registered name and the failover event immediately.
b8809f5 @uwiger add monitor(Key, follow), bug fixes for standby
uwiger authored
1162
1163
1164 `monitor(Key, follow)` keeps monitoring the registered name even if it is
1165 temporarily unregistered. The messages received are the same as for the other
1166 monitor types, but `{gproc, registered, Ref, Key}` is also sent when a new
1167 process registers the name.
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1168 <a name="mreg-3"></a>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1169
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1170 ### mreg/3 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1171
1172
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1173 <pre><code>
1174 mreg(T::<a href="#type-type">type()</a>, C::<a href="#type-scope">scope()</a>, KVL::[{Key::any(), Value::any()}]) -&gt; true
1175 </code></pre>
1176
1177 <br></br>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1178
1179
1180
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1181 Register multiple {Key,Value} pairs of a given type and scope.
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1182
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1183
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1184 This function is more efficient than calling [`reg/2`](#reg-2) repeatedly.
75f0298 Added gproc:munreg/3
Ulf Wiger authored
1185 It is also atomic in regard to unique names; either all names are registered
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1186 or none are.
1187 <a name="munreg-3"></a>
75f0298 Added gproc:munreg/3
Ulf Wiger authored
1188
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1189 ### munreg/3 ###
75f0298 Added gproc:munreg/3
Ulf Wiger authored
1190
1191
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1192 <pre><code>
1193 munreg(T::<a href="#type-type">type()</a>, C::<a href="#type-scope">scope()</a>, L::[Key::any()]) -&gt; true
1194 </code></pre>
75f0298 Added gproc:munreg/3
Ulf Wiger authored
1195
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1196 <br></br>
75f0298 Added gproc:munreg/3
Ulf Wiger authored
1197
1198
1199
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1200 Unregister multiple Key items of a given type and scope.
75f0298 Added gproc:munreg/3
Ulf Wiger authored
1201
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1202
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1203 This function is usually more efficient than calling [`unreg/1`](#unreg-1)
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1204 repeatedly.
1205 <a name="nb_wait-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1206
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1207 ### nb_wait/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1208
1209
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1210 <pre><code>
1211 nb_wait(Key::<a href="#type-key">key()</a>) -&gt; Ref
1212 </code></pre>
1213
4ffd1fa added surrender/2
Ulf Wiger authored
1214 <br></br>
1215
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1216
1217 Wait for a local name to be registered.
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1218 The caller can expect to receive a message,
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1219 {gproc, Ref, registered, {Key, Pid, Value}}, once the name is registered.
1220 <a name="nb_wait-2"></a>
1221
1222 ### nb_wait/2 ###
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
1223
1224
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1225 <pre><code>
1226 nb_wait(Node::node(), Key::<a href="#type-key">key()</a>) -&gt; Ref
1227 </code></pre>
603dd7e @uwiger distributed wait (await/3, wide_await/3, et al)
uwiger authored
1228
1229 <br></br>
1230
1231
1232 Wait for a local name to be registered on `Node`.
1233 The caller can expect to receive a message,
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1234 {gproc, Ref, registered, {Key, Pid, Value}}, once the name is registered.
1235 <a name="next-2"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1236
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1237 ### next/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1238
1239
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1240 <pre><code>
1241 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'
1242 </code></pre>
1243
4ffd1fa added surrender/2
Ulf Wiger authored
1244 <br></br>
1245
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1246
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1247
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1248 Behaves as ets:next(Tab,Key) for a given type of registration.
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1249
1250
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1251 See [`http://www.erlang.org/doc/man/ets.html#next-2`](http://www.erlang.org/doc/man/ets.html#next-2).
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1252 The registry behaves as an ordered_set table.
1253 <a name="prev-2"></a>
1254
1255 ### prev/2 ###
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1256
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1257
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1258 <pre><code>
1259 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'
1260 </code></pre>
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1261
4ffd1fa added surrender/2
Ulf Wiger authored
1262 <br></br>
1263
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1264
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1265
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1266 Behaves as ets:prev(Tab,Key) for a given type of registration.
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1267
1268
d220c61 @uwiger docs rebuilt with new edown
uwiger authored
1269 See [`http://www.erlang.org/doc/man/ets.html#prev-2`](http://www.erlang.org/doc/man/ets.html#prev-2).
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1270 The registry behaves as an ordered_set table.
1271 <a name="reg-1"></a>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1272
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1273 ### reg/1 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1274
1275
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1276 <pre><code>
1277 reg(Key::<a href="#type-key">key()</a>) -&gt; true
1278 </code></pre>
1279
4ffd1fa added surrender/2
Ulf Wiger authored
1280 <br></br>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1281
1282
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1283 Equivalent to [`reg(Key, default(Key))`](#reg-2).
1284 <a name="reg-2"></a>
4ffd1fa added surrender/2
Ulf Wiger authored
1285
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1286 ### reg/2 ###
68e0d19 re-generated docs with updated edown
Ulf Wiger authored
1287
1288
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1289 <pre><code>
1290 reg(Key::<a href="#type-key">key()</a>, Value) -&gt; true
1291 </code></pre>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored
1292
05cd9f8 @uwiger Added attributes, update_counter() on names, gproc_pool
uwiger authored
1293 <br></br>
fcdd5ac rebuilt edoc info using edown
Ulf Wiger authored