diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2015-02-03 12:44:39 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2015-02-03 12:44:39 +0000 |
| commit | 52abb3b207788eb80801b2397727e1bd8f34feaf (patch) | |
| tree | 198ebadd909652b924fe1cfacebdfca5d5807c9b | |
| parent | 5d07cfc33963e718f7c75cfda27a1ffd63f2016e (diff) | |
| parent | 059e64062922c6f2448e48fecb10cb1537176e31 (diff) | |
| download | rabbitmq-server-git-52abb3b207788eb80801b2397727e1bd8f34feaf.tar.gz | |
Merge bug26578
| -rw-r--r-- | src/gatherer.erl | 14 |
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]). |
