|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
#include <task.hpp>
Public Types | |
| using | promise_type = detail::TaskPromise<T> |
| using | handle_type = std::coroutine_handle<promise_type> |
Public Member Functions | |
| Task () noexcept=default | |
| Task (handle_type h) noexcept | |
| Task (const Task &)=delete | |
| Task & | operator= (const Task &)=delete |
| Task (Task &&o) noexcept | |
| Task & | operator= (Task &&o) noexcept |
| ~Task () | |
| bool | done () const noexcept |
| auto | operator co_await () &&noexcept |
| Make the task awaitable. | |
| void | start () |
| Eagerly start the task without awaiting it. Use blocking_get() if you need the result. | |
| void | start_detached () && |
| Start the task and detach it: the coroutine frame stays alive until the coroutine completes, even after this Task object is destroyed. | |
| void | start_detached_ () |
| Lvalue convenience used internally by AsyncCommand. | |
| T | blocking_get () |
| Blocking accessor — only safe if the task body is synchronous (no real async). | |
| using aria::async::Task< T >::promise_type = detail::TaskPromise<T> |
| using aria::async::Task< T >::handle_type = std::coroutine_handle<promise_type> |
|
defaultnoexcept |
|
inlineexplicitnoexcept |
|
delete |
|
inlinenoexcept |
|
inline |
|
delete |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
|
inline |
Eagerly start the task without awaiting it. Use blocking_get() if you need the result.
|
inline |
Start the task and detach it: the coroutine frame stays alive until the coroutine completes, even after this Task object is destroyed.
The frame is automatically destroyed on completion — no leaks. Pass a fresh task or an already-completed task. An asynchronous operation must retain control of resuming a task already parked in it.
Detached final suspension is ready immediately: normal coroutine completion releases the frame, including any unobserved result or exception. No final awaiter destroys its own frame while returning a continuation handle. An already-completed task is just released.
|
inline |
Lvalue convenience used internally by AsyncCommand.
|
inline |
Blocking accessor — only safe if the task body is synchronous (no real async).
For real async use co_await or a Scheduler.