Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::UiAsyncContext Class Reference

Weak context copied into owning coroutine parameters; never extends the UI owner's life. More...

#include <async.hpp>

Public Member Functions

 UiAsyncContext ()=default
 Empty closed context.
AsyncTimer until (SchedulerTime deadline) const
template<class T>
AsyncReceive< T > receive (std::function< void(AsyncReply< T >)> start) const
 Register one completion before calling the owning UI provider-start callback.

Friends

class UiAsync
struct ui::detail::MessageAccess

Detailed Description

Weak context copied into owning coroutine parameters; never extends the UI owner's life.

Member Function Documentation

◆ receive()

template<class T>
AsyncReceive< T > portals::UiAsyncContext::receive ( std::function< void(AsyncReply< T >)> start) const
inline

Register one completion before calling the owning UI provider-start callback.

Template Parameters
TTransitively immutable owning domain result type.
Parameters
startUI callback receiving only a worker-safe reply; must retain rejected results for retry. Do not dispatch recursively; capture materialization may throw in the caller expression.
Returns
Owning data awaiter; provider exceptions become typed await failures.

◆ until()

AsyncTimer portals::UiAsyncContext::until ( SchedulerTime deadline) const
inline
Parameters
deadlineAbsolute monotonic milliseconds in this owner's SchedulerClock; no extra rounding.
Returns
Owning one-shot awaiter; even past deadlines wait for dispatch and its timer budget.

The documentation for this class was generated from the following file: