summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gatherer.erl14
-rw-r--r--src/pmon.erl13
2 files changed, 27 insertions, 0 deletions
diff --git a/src/gatherer.erl b/src/gatherer.erl
index 8bce170754..6a71021686 100644
--- a/src/gatherer.erl
+++ b/src/gatherer.erl
@@ -16,6 +16,20 @@
-module(gatherer).
+%% Gatherer is a queue which has producer and consumer processes. Before producers
+%% push items to the queue using gatherer:in/2 they need to declare their intent
+%% to do so with gatherer:fork/1. When a publisher's work is done, it states so
+%% using gatherer:finish/1.
+%%
+%% Consumers pop messages off queues with gatherer:out/1. If a queue is empty
+%% and there are producers that haven't finished working, the caller is blocked
+%% until an item is available. If there are no active producers, gatherer:out/1
+%% immediately returns 'empty'.
+%%
+%% This module is primarily used to collect results from asynchronous tasks
+%% running in a worker pool, e.g. when recovering bindings or rebuilding
+%% message store indices.
+
-behaviour(gen_server2).
-export([start_link/0, stop/1, fork/1, finish/1, in/2, sync_in/2, out/1]).
diff --git a/src/pmon.erl b/src/pmon.erl
index a94f5a67af..7981742284 100644
--- a/src/pmon.erl
+++ b/src/pmon.erl
@@ -16,6 +16,19 @@
-module(pmon).
+%% Process Monitor
+%% ================
+%%
+%% This module monitors processes so that every process has at most
+%% 1 monitor.
+%% Processes monitored can be dynamically added and removed.
+%%
+%% Unlike erlang:[de]monitor* functions, this module
+%% provides basic querying capability and avoids contacting down nodes.
+%%
+%% It is used to monitor nodes, queue mirrors, and by
+%% the queue collector, among other things.
+
-export([new/0, new/1, monitor/2, monitor_all/2, demonitor/2,
is_monitored/2, erase/2, monitored/1, is_empty/1]).