13#include <boost/assert.hpp>
147 "too many coroutines waiting for reading/writing a channel");
Definition bounded_queue.h:23
T get()
Pop an item from the queue.
Definition bounded_queue.h:45
void put(U &&elem)
Push an item to the queue.
Definition bounded_queue.h:29
bool empty() const
size() == 0
Definition bounded_queue.h:59
bool hasSpace() const
size() < capacity()
Definition bounded_queue.h:61
void awake_writer()
Definition channel.h:129
Promise< void > put(U &&value)
Definition channel.h:59
Channel(unsigned capacity, unsigned max_waiters=16)
Create a channel for up to capacity items.
Definition channel.h:46
BoundedQueue< std::coroutine_handle<> > write_waiting_
Definition channel.h:119
BoundedQueue< std::coroutine_handle<> > read_waiting_
Definition channel.h:118
void awake_reader()
Definition channel.h:121
MultiPromise< T > getAll()
Definition channel.h:101
BoundedQueue< T > queue_
Definition channel.h:115
Promise< T > get()
Definition channel.h:83
static void enqueue(std::coroutine_handle<> handle)
Definition loop.cc:73
Definition multipromise.h:133
Definition async_work.cc:17
BoundedQueue< T > & queue_
Definition channel.h:156
bool await_resume()
Definition channel.h:153
BoundedQueue< std::coroutine_handle<> > & waiters_
Definition channel.h:157
ChannelAwaiter_(BoundedQueue< T > &queue, BoundedQueue< std::coroutine_handle<> > &slot)
Definition channel.h:137
bool await_ready()
Definition channel.h:141
bool await_suspend(std::coroutine_handle<> handle)
Definition channel.h:143
Definition exception.h:19