Equalizer
1.4.1
|
The consumer end of a distributed queue. More...
#include <queueSlave.h>
Public Member Functions | |
CO_API | QueueSlave (const uint32_t prefetchMark=Global::getIAttribute(Global::IATTR_QUEUE_MIN_SIZE), const uint32_t prefetchAmount=Global::getIAttribute(Global::IATTR_QUEUE_REFILL)) |
Construct a new queue consumer. | |
virtual CO_API | ~QueueSlave () |
Destruct this new queue consumer. | |
CO_API Command * | pop () |
Pop an item from the distributed queue. |
The consumer end of a distributed queue.
One or more instances of this class are mapped to the identifier of the QueueMaster registered on another node.
Definition at line 37 of file queueSlave.h.
CO_API co::QueueSlave::QueueSlave | ( | const uint32_t | prefetchMark = Global::getIAttribute(Global::IATTR_QUEUE_MIN_SIZE) , |
const uint32_t | prefetchAmount = Global::getIAttribute(Global::IATTR_QUEUE_REFILL) |
||
) |
Construct a new queue consumer.
The implementation will prefetch items from the queue master to cache thems locally. The prefetchMark determines when new items are requested, and the prefetchAmount how many items are fetched. Prefetching items hides the network latency by pipelining the network communication with the processing but may introduce imbalance between queue slaves if used aggressively.
prefetchMark | the low-water mark for prefetching. |
prefetchAmount | the refill quantity when prefetching. |
virtual CO_API co::QueueSlave::~QueueSlave | ( | ) | [virtual] |
Destruct this new queue consumer.
CO_API Command* co::QueueSlave::pop | ( | ) |
Pop an item from the distributed queue.
If the queue is empty, 0 is returned. Otherwise the returned command has to be released by the caller.