Class Queue

A queue, useful for coordinating producer and consumer coroutines.

If maxSize is equal to zero, the queue size is infinite. Otherwise put() will block when the queue reaches maxsize, until an item is removed by get().

You can reliably know this Queue's size with qsize(), since your single-threaded asynchronous application won't be interrupted between calling qsize() and doing an operation on the Queue.

This class is not thread safe.

Inherits from

  • Object (base class)

Properties

Name Type Description
empty [get] bool Return true if the queue is empty, false otherwise.
full [get] bool Return true if there are maxsize items in the queue.
maxsize [get] size_t Number of items allowed in the queue.
qsize [get] size_t Number of items in the queue.

Methods

Name Description
get Remove and return an item from the queue.
getNowait Remove and return an item from the queue.
join Block until all items in the queue have been gotten and processed.
put Put an item into the queue.
putNowait Put an item into the queue without blocking.
taskDone Indicate that a formerly enqueued task is complete.

Authors

Dragos Carp

Copyright

© 2015-2016 Dragos Carp

License

Boost Software License - Version 1.0