Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 78 lines (37 sloc) 1.979 kb
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
1
2
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
3 #Module gproc_monitor#
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
4 * [Description](#description)
5 * [Function Index](#index)
6 * [Function Details](#functions)
7
8
9
10 This module implements a notification system for gproc names
11 When a process subscribes to notifications for a given name, a message
12 will be sent each time that name is registered.
13
14 __Behaviours:__ [`gen_server`](gen_server.md).
15
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
16 __Authors:__ Ulf Wiger ([`ulf.wiger@feuerlabs.com`](mailto:ulf.wiger@feuerlabs.com)).<a name="index"></a>
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
17
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
18 ##Function Index##
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
19
20
21 <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td>
efeaf8b @uwiger documentation fixes (esp gproc:select/[1,2])
authored
22 Starts the server.</td></tr><tr><td valign="top"><a href="#subscribe-1">subscribe/1</a></td><td>
23 Subscribe to registration events for a certain name.</td></tr><tr><td valign="top"><a href="#unsubscribe-1">unsubscribe/1</a></td><td>
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
24 Unsubscribe from registration events for a certain name.</td></tr></table>
25
26
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
27 <a name="functions"></a>
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
28
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
29 ##Function Details##
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
30
31 <a name="start_link-0"></a>
32
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
33 ###start_link/0##
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
34
35
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
36 <pre>start_link() -&gt; {ok, Pid} | ignore | {error, Error}</pre>
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
37 <br></br>
38
39
40
41 Starts the server
42 <a name="subscribe-1"></a>
43
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
44 ###subscribe/1##
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
45
46
0f84360 @uwiger docs rebuilt with new edown
authored
47 <pre>subscribe(Key::<a href="#type-key">key()</a>) -> ok</pre>
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
48 <br></br>
49
50
51
52
53
d220c61 @uwiger docs rebuilt with new edown
authored
54 Subscribe to registration events for a certain name
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
55
56
57
58 The subscribing process will receive a `{gproc_monitor, Name, Pid}` message
59 whenever a process registers under the given name, and a
efeaf8b @uwiger documentation fixes (esp gproc:select/[1,2])
authored
60 `{gproc_monitor, Name, undefined}` message when the name is unregistered,
d220c61 @uwiger docs rebuilt with new edown
authored
61 either explicitly, or because the registered process dies.
62
63 When the subscription is first ordered, one of the above messages will be
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
64 sent immediately, indicating the current status of the name.<a name="unsubscribe-1"></a>
65
b5c9cd2 @uwiger resolve race in gproc:await/2
authored
66 ###unsubscribe/1##
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
67
68
0f84360 @uwiger docs rebuilt with new edown
authored
69 <pre>unsubscribe(Key::<a href="#type-key">key()</a>) -> ok</pre>
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
70 <br></br>
71
72
73
74
75
d220c61 @uwiger docs rebuilt with new edown
authored
76 Unsubscribe from registration events for a certain name
a8297b2 gproc_monitor, local only, no test cases
Ulf Wiger authored
77
d220c61 @uwiger docs rebuilt with new edown
authored
78 This function is the reverse of subscribe/1. It removes the subscription.
Something went wrong with that request. Please try again.