Awaitable object representing an event. A user can co_await on this object to resume the next time the event is fired, optionally with a condition.
More...
|
| awaitable (const awaitable &)=delete |
|
| awaitable (awaitable &&rhs) noexcept |
|
awaitable & | operator= (const awaitable &)=delete |
|
awaitable & | operator= (awaitable &&rhs) noexcept |
|
void | cancel () |
| Request cancellation. This will detach this object from the event router and resume the awaiter, which will be thrown dpp::task_cancelled::exception. More...
|
|
constexpr bool | await_ready () const noexcept |
| First function called by the standard library when awaiting this object. Returns true if we need to suspend. More...
|
|
void | await_suspend (detail::std_coroutine::coroutine_handle<> caller) |
| Second function called by the standard library when awaiting this object, after suspension. This will attach the object to its event router, to be resumed on the next event that satisfies the predicate. More...
|
|
const T & | await_resume () |
| Third and final function called by the standard library, called when resuming the coroutine. More...
|
|
template<typename T>
class dpp::detail::event_router::awaitable< T >
Awaitable object representing an event. A user can co_await on this object to resume the next time the event is fired, optionally with a condition.
Request cancellation. This will detach this object from the event router and resume the awaiter, which will be thrown dpp::task_cancelled::exception.
- Exceptions
-
??? | As this resumes the coroutine, it may throw any exceptions at the caller. |
If state == none (was never awaited), do nothing If state == waiting, prevent resumption, resume on our end If state == resuming || cancelling, ignore