SW Task Event Loop Framework v1.0.0
High-performance C++ asynchronous event loop framework with timer management and promise-based programming
|
Awaitable for delay operations. More...
#include <Awaitable.h>
Public Member Functions | |
DelayAwaitable (std::shared_ptr< SLLooper > looper, int delayMs) | |
Construct DelayAwaitable with delay duration. | |
bool | await_ready () const noexcept |
Check if delay is ready (coroutine interface) | |
void | await_suspend (std::coroutine_handle<> handle) const noexcept |
Suspend coroutine and start timer. | |
void | await_resume () const noexcept |
Resume coroutine after delay (no return value) | |
int | getDelayMs () const |
Get delay duration. | |
std::shared_ptr< SLLooper > | getLooper () const |
Get the SLLooper instance. | |
void | setReady () const |
Mark delay as completed (internal use) | |
Awaitable for delay operations.
Provides coroutine-based delay functionality using SLLooper's timer system. Suspends the coroutine for a specified duration.
Definition at line 208 of file Awaitable.h.
|
inline |
Construct DelayAwaitable with delay duration.
looper | Shared pointer to SLLooper |
delayMs | Delay duration in milliseconds |
Definition at line 220 of file Awaitable.h.
|
inlinenoexcept |
Check if delay is ready (coroutine interface)
Definition at line 227 of file Awaitable.h.
|
inlinenoexcept |
Resume coroutine after delay (no return value)
Definition at line 238 of file Awaitable.h.
|
noexcept |
Suspend coroutine and start timer.
handle | Coroutine handle for resumption |
Definition at line 246 of file SLLooper.cpp.
References SLLOOPER_DEBUG, and SLLOOPER_DEBUG_STREAM.
|
inline |
|
inline |
Get the SLLooper instance.
Definition at line 250 of file Awaitable.h.
|
inline |
Mark delay as completed (internal use)
Definition at line 255 of file Awaitable.h.