A bounded queue for type-erased Messages.
More...
#include <queue.hpp>
Public Member Functions | |
| coro::task< std::optional< Ticket > > | acquire () |
| Acquire a ticket to send into the queue. More... | |
| coro::task< std::pair< coro::task< void >, Message > > | receive () |
| Receive a message from the queue. More... | |
| coro::task< void > | drain (std::unique_ptr< coro::thread_pool > &executor) |
| Drain all messages in the queue and shut down. More... | |
| coro::task< void > | shutdown () |
| Immediately shut down the queue. More... | |
| BoundedQueue::Shutdown | raii_shutdown () noexcept |
| Obtain an object that will synchronously shutdown the queue when it goes out of scope. More... | |
A bounded queue for type-erased Messages.
This adds a semaphore-based ticketing system to coro::queue. The producer must acquire a ticket which is sent with the message to the consumer who can decide when to release the ticket having received the message.
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |