Clio develop
The XRP Ledger API server.
|
A wrapper for std::priority_queue that serialises operations using a strand. More...
#include <StrandedPriorityQueue.hpp>
Public Member Functions | |
StrandedPriorityQueue (util::async::AnyStrand &&strand, std::optional< std::size_t > limit=std::nullopt) | |
Construct a new priority queue on a strand. | |
template<typename I > requires std::is_same_v<std::decay_t<I>, T> | |
bool | enqueue (I &&item) |
Enqueue a new item onto the queue if space is available. | |
std::optional< T > | dequeue () |
Dequeue the next available item out of the queue. | |
bool | empty () |
Check if the queue is empty. | |
A wrapper for std::priority_queue that serialises operations using a strand.
|
inline |
Construct a new priority queue on a strand.
strand | The strand to use |
limit | The limit of items allowed simultaniously in the queue |
|
inlinenodiscard |
Dequeue the next available item out of the queue.
|
inlinenodiscard |
Check if the queue is empty.
|
inlinenodiscard |
Enqueue a new item onto the queue if space is available.
I | Type of the item to add |
item | The item to add |