|
Lightweight 0.20260617.0
|
#include <Task.hpp>
Public Types | |
| using | promise_type = detail::TaskPromise< T > |
| The coroutine promise type required by the C++ coroutine machinery. | |
| using | Handle = std::coroutine_handle< promise_type > |
| The typed coroutine handle owned by this Task. | |
Public Member Functions | |
| Task () noexcept=default | |
| Constructs an empty Task that owns no coroutine. | |
| Task (Handle handle) noexcept | |
| Task (Task &&other) noexcept | |
| Task & | operator= (Task &&other) noexcept |
| Task (Task const &)=delete | |
| Task & | operator= (Task const &)=delete |
| bool | IsValid () const noexcept |
| bool | IsReady () const noexcept |
| Handle | GetHandle () const noexcept |
| auto | operator co_await () &&noexcept |
A lazy, move-only C++23 coroutine task.
A Task<T> represents an asynchronous computation that yields a value of type T (or nothing for Task<void>). It is lazy — the coroutine body does not start executing until the Task is co_await-ed by another coroutine or driven to completion by SyncWait / SyncWaitPumping. Awaiting uses symmetric transfer, so chains of awaits do not grow the stack. Exceptions thrown inside the body are captured and rethrown at the awaiting site (parity with the throwing synchronous API).
| T | The value type produced by the task (defaults to void). |
| using Lightweight::Async::Task< T >::promise_type = detail::TaskPromise<T> |
| using Lightweight::Async::Task< T >::Handle = std::coroutine_handle<promise_type> |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |