Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 1.98 KB

gproc_monitor.md

File metadata and controls

73 lines (45 loc) · 1.98 KB

Module gproc_monitor

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 (ulf.wiger@feuerlabs.com).

Function Index

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.

Function Details

start_link/0


start_link() -> {ok, Pid} | ignore | {error, Error}

Starts the server

subscribe/1


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/1


unsubscribe(Key::key()) -> ok

Unsubscribe from registration events for a certain name

This function is the reverse of subscribe/1. It removes the subscription.