#include <icy/queue.h>Inherits:
RunnableQueue< T >Subclassed by:SyncPacketQueue< T >
SyncQueue extends Synchronizer to implement a synchronized FIFO queue which receives T objects from any thread and synchronizes them for safe consumption by the associated event loop.
| Return | Name | Description |
|---|---|---|
SyncQueue inline | #### Parameters | |
~SyncQueue virtual inline | Destruction is deferred to allow enough time for all callbacks to return. | |
void | push virtual inline | Pushes an item onto the queue and wakes the event loop for dispatch. Ownership of item is transferred to the queue. |
void | cancel virtual inline | Cancels the queue and its underlying synchronizer. |
Synchronizer & | sync inline | #### Returns |
inline
inline SyncQueue(uv::Loop * loop, int limit, int timeout)loop Event loop used by the internal [Synchronizer](icy-Synchronizer.html#synchronizer).
limit Maximum queued items; oldest are dropped when exceeded.
timeout Dispatch timeout in milliseconds passed to [RunnableQueue](icy-RunnableQueue.html#runnablequeue).
virtual inline
virtual inline ~SyncQueue()Destruction is deferred to allow enough time for all callbacks to return.
virtual inline
virtual inline void push(T * item)Pushes an item onto the queue and wakes the event loop for dispatch. Ownership of item is transferred to the queue.
item Heap-allocated item to enqueue; the queue takes ownership.virtual inline
virtual inline void cancel(bool flag)Cancels the queue and its underlying synchronizer.
flag True to cancel, false to un-cancel.inline
inline Synchronizer & sync()Reference to the underlying [Synchronizer](icy-Synchronizer.html#synchronizer) handle.
| Return | Name | Description |
|---|---|---|
Synchronizer | _sync |
Synchronizer _sync| Name | Description |
|---|---|
Queue |
RunnableQueue< T > Queue()