This module implements a notification system for gproc names
When a process subscribes to notifications for a given name, a message
will be sent each time that name is registered.
Behaviours: gen_server
.
Authors: Ulf Wiger ([email protected]
).
start_link/0 | Starts the server. |
subscribe/1 | Subscribe to registration events for a certain name. |
unsubscribe/1 | Unsubscribe from registration events for a certain name. |
start_link() -> {ok, Pid} | ignore | {error, Error}
Starts the server
subscribe(Key::key()) -> ok
Subscribe to registration events for a certain name
The subscribing process will receive a {gproc_monitor, Name, Pid}
message
whenever a process registers under the given name, and a
{gproc_monitor, Name, undefined}
message when the name is unregistered,
either explicitly, or because the registered process dies.
When the subscription is first ordered, one of the above messages will be sent immediately, indicating the current status of the name.
unsubscribe(Key::key()) -> ok
Unsubscribe from registration events for a certain name
This function is the reverse of subscribe/1. It removes the subscription.