A wrapper for std::priority_queue that serialises operations using a mutex.
More...
#include <TaskQueue.hpp>
A wrapper for std::priority_queue that serialises operations using a mutex.
- Note
- This may be a candidate for future improvements if performance proves to be poor (e.g. use a lock free queue)
◆ TaskQueue()
etlng::impl::TaskQueue::TaskQueue |
( |
Settings | settings | ) |
|
|
inlineexplicit |
Construct a new priority queue.
- Parameters
-
limit | The limit of items allowed simultaneously in the queue |
◆ dequeue()
Dequeue the next available item out of the queue.
- Note
- This function blocks until the item is taken off the queue
- Returns
- An item if available; nullopt otherwise
◆ empty()
bool etlng::impl::TaskQueue::empty |
( |
| ) |
|
|
inlinenodiscard |
Check if the queue is empty.
- Note
- This function blocks until the queue is checked
- Returns
- true if the queue is empty; false otherwise
◆ enqueue()
Enqueue a new item onto the queue if space is available.
- Note
- This function blocks until the item is attempted to be added to the queue
- Parameters
-
- Returns
- true if item added to the queue; false otherwise
The documentation for this class was generated from the following file: