SW Task Event Loop Framework v1.0.0
High-performance C++ asynchronous event loop framework with timer management and promise-based programming
|
Specialization for void return type. More...
#include <Awaitable.h>
Public Member Functions | |
template<typename Func > | |
WorkAwaitable (std::shared_ptr< SLLooper > looper, Func &&func) | |
Construct WorkAwaitable with void function. | |
bool | await_ready () const noexcept |
Check if work is ready (coroutine interface) | |
void | await_suspend (std::coroutine_handle<> handle) const noexcept |
Suspend coroutine and execute work on background thread. | |
void | await_resume () const |
Resume coroutine after void work completion. | |
std::shared_ptr< SLLooper > | getLooper () const |
Get the SLLooper instance. | |
std::function< void()> | getFunc () const |
Get the work function. | |
void | setResult () const |
Mark work as completed (internal use) | |
void | setException (std::exception_ptr ex) const |
Set exception result (internal use) | |
Specialization for void return type.
Specialized version of WorkAwaitable for functions that return void. Avoids std::optional<void> compilation issues.
Definition at line 131 of file Awaitable.h.
|
inline |
Construct WorkAwaitable with void function.
Func | Function type (auto-deduced) |
looper | Shared pointer to SLLooper |
func | Void function to execute on background thread |
Definition at line 146 of file Awaitable.h.
|
inlinenoexcept |
Check if work is ready (coroutine interface)
Definition at line 153 of file Awaitable.h.
|
inline |
Resume coroutine after void work completion.
std::exception | if work failed |
Definition at line 165 of file Awaitable.h.
|
noexcept |
Suspend coroutine and execute work on background thread.
handle | Coroutine handle for resumption |
Definition at line 281 of file SLLooper.cpp.
References SLLOOPER_DEBUG, SLLOOPER_ERROR, and SLLOOPER_ERROR_STREAM.
|
inline |
|
inline |
Get the SLLooper instance.
Definition at line 174 of file Awaitable.h.
|
inline |
Set exception result (internal use)
ex | Exception pointer from work function |
Definition at line 191 of file Awaitable.h.
|
inline |
Mark work as completed (internal use)
Definition at line 185 of file Awaitable.h.