Optional UI owner of at most one coroutine frame and one wait, with no separate runtime. Uses one permanent node-scope registration and at most one timer/data registration. Existing Scheduler capacities and dispatch budgets apply. Tree and scheduler must outlive this owner. Destruction is UI-only, does not join workers, and defers a currently executing frame's release until resume returns. No method requests redraw; coroutine application effects invalidate explicitly.
More...
#include <async.hpp>
|
|
struct | ui::detail::AsyncAccess |
Optional UI owner of at most one coroutine frame and one wait, with no separate runtime. Uses one permanent node-scope registration and at most one timer/data registration. Existing Scheduler capacities and dispatch budgets apply. Tree and scheduler must outlive this owner. Destruction is UI-only, does not join workers, and defers a currently executing frame's release until resume returns. No method requests redraw; coroutine application effects invalidate explicitly.
◆ cancel()
| std::expected< void, AsyncError > portals::UiAsync::cancel |
( |
| ) |
|
Cancel on UI; suspended frame is released now, executing frame after resume returns.
- Returns
- Success including idle/completed owners, or WRONG_THREAD. Outcome remains inspectable.
◆ close()
| std::expected< void, AsyncError > portals::UiAsync::close |
( |
| ) |
|
Permanently close on UI without joining; idempotent.
- Returns
- Success or WRONG_THREAD; outcome remains readable after closure/removal.
◆ context()
- Returns
- Weak context for owning parameters of a free/static coroutine function; foreign access returns an empty context without reading mutable UI state.
◆ create()
- Parameters
-
| scheduler | Existing UI scheduler; must own the node scope and outlive this owner. |
| tree | Existing UI tree; must outlive the owner. |
| context | Live node whose removal cancels the frame and closes this owner. |
- Returns
- UI owner, or typed context/thread/frame/registration/allocation failure.
◆ outcome()
- Returns
- Retained invocation outcome, including after node removal; WRONG_THREAD on foreign access.
◆ start()
Adopt and initially resume on UI; subsequent waits resume through scheduler dispatch.
- Parameters
-
| task | Lazy task created on this UI thread; consumed only on successful adoption. |
| restart | Explicit repeated-action policy, defaulting to preserving running work. |
- Returns
- Admission success, or typed rejection. Self-close/removal during first resume returns CLOSED; business success/failure is separately retained by outcome(). Rejection before adoption preserves task; first-resume failure has consumed it.
The documentation for this class was generated from the following file: