![]() |
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
Internal awaitable used to wait for events. More...
#include <event.hpp>
Classes | |
| class | Awaiter |
Public Types | |
| enum class | StopTokenBehavior { respect , ignore } |
Public Member Functions | |
| LowLevelEventAwaitable (const LowLevelEventAwaitable &)=delete | |
| LowLevelEventAwaitable & | operator= (const LowLevelEventAwaitable &)=delete |
| LowLevelEventAwaitable (LowLevelEventAwaitable &&other) noexcept | |
| LowLevelEventAwaitable & | operator= (LowLevelEventAwaitable &&other) noexcept |
| ImmediateAwaitable< Awaiter > | get_awaitable () && |
| Create awaitable for this event with default configuration. | |
| ImmediateAwaitable< Awaiter > | get_awaitable (StopTokenBehavior stop_token_behavior, std::function< void()> callback) && |
| Create awaitable for this event. | |
Friends | |
| std::pair< Event, EventAwaitable > | mrs_lib::coro::make_event () |
Internal awaitable used to wait for events.
This should likely not be used outside of coroutine library functions.
| auto mrs_lib::coro::internal::LowLevelEventAwaitable::get_awaitable | ( | StopTokenBehavior | stop_token_behavior, |
| std::function< void()> | callback | ||
| ) | && |
Create awaitable for this event.
| stop_token_behavior | Whether to respect stop token request to cancel the await. |
| callback | Callback to run during suspend. |
The callback is only run if the coroutine is suspended.
The callback can be used to register a waker that will start the coroutine once ready.