|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
The awaiter delay() returns: suspends until a TimeoutScheduler entry fires, or until a stop withdraws it. More...
#include <coroutine.hpp>
Public Member Functions | |
| DelayAwaiter (detail::TimeoutScheduler &scheduler, std::chrono::milliseconds duration) | |
| ~DelayAwaiter () | |
| Withdraws the wait if the frame is destroyed while suspended. | |
| DelayAwaiter (const DelayAwaiter &)=delete | |
| DelayAwaiter & | operator= (const DelayAwaiter &)=delete |
| DelayAwaiter (DelayAwaiter &&)=delete | |
| DelayAwaiter & | operator= (DelayAwaiter &&)=delete |
| constexpr bool | await_ready () const noexcept |
| template<typename Promise> | |
| bool | await_suspend (std::coroutine_handle< Promise > awaiting) |
| void | await_resume () |
The awaiter delay() returns: suspends until a TimeoutScheduler entry fires, or until a stop withdraws it.
Resumes on the executor the awaiting coroutine was running on (core-cpp's current executor), or on the scheduler's loop thread if there was none. With a stoppable token on the awaiting promise, a stop cancels the scheduler entry – its capture is released on the scheduler's loop – and resumes the coroutine with core::async::OperationCancelled on the same executor, or, with none, inline on the thread that requested the stop. Exactly one of the timer and the stop resumes it.
Definition at line 139 of file coroutine.hpp.
|
inline |
| scheduler | The scheduler whose entry times the wait; must outlive it. |
| duration | How long to wait at least. |
Definition at line 196 of file coroutine.hpp.
|
inline |
Withdraws the wait if the frame is destroyed while suspended.
Definition at line 202 of file coroutine.hpp.
|
inlinenodiscardconstexprnoexcept |
Definition at line 217 of file coroutine.hpp.
|
inline |
| Promise | The awaiting coroutine's promise type. |
| awaiting | The coroutine performing the co_await. |
Definition at line 224 of file coroutine.hpp.
|
inline |
| core::async::OperationCancelled | if a stop withdrew the wait. |
Definition at line 259 of file coroutine.hpp.