summaryrefslogtreecommitdiff
path: root/src/gatherer.erl
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-03-11 16:17:25 +0100
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2015-03-11 16:17:25 +0100
commit17a5da8f085e4d4acb349fc41ceca0e923ac67d3 (patch)
tree6d3b51561ea384f3b51f477b05d91237ebe1f3e7 /src/gatherer.erl
parente03e7da3115c54e8a7ca54ad3cc2c4c74f7ed417 (diff)
parent578cfc1916a4b6a8202b2f4698e35eb76942f061 (diff)
downloadrabbitmq-server-git-17a5da8f085e4d4acb349fc41ceca0e923ac67d3.tar.gz
Merge branch 'master' into stable
Diffstat (limited to 'src/gatherer.erl')
-rw-r--r--src/gatherer.erl14
1 files changed, 14 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]).