Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::AsyncReply< T > Class Template Reference

Copyable producer endpoint owning no UI state, callbacks or coroutine frame. T and its deleter must support transitively immutable shared ownership on any releasing thread. One accepted completion ends admission; rejected publication leaves retry possible. The producer must retain the reply and result on WOULD_BLOCK and retry when capacity returns. Synchronous completion queues a value; it never resumes a coroutine inline. More...

#include <async.hpp>

Public Member Functions

 AsyncReply ()=default
 Empty closed endpoint.
std::expected< PublishResult, AsyncError > complete (std::shared_ptr< const T > value) const
std::expected< PublishResult, AsyncError > fail (AsyncError error) const

Friends

template<class>
class AsyncReceive

Detailed Description

template<class T>
class portals::AsyncReply< T >

Copyable producer endpoint owning no UI state, callbacks or coroutine frame. T and its deleter must support transitively immutable shared ownership on any releasing thread. One accepted completion ends admission; rejected publication leaves retry possible. The producer must retain the reply and result on WOULD_BLOCK and retry when capacity returns. Synchronous completion queues a value; it never resumes a coroutine inline.

Template Parameters
TImmutable owning result type; raw widget/view references are unsuitable.

Member Function Documentation

◆ complete()

template<class T>
std::expected< PublishResult, AsyncError > portals::AsyncReply< T >::complete ( std::shared_ptr< const T > value) const
inline
Parameters
valueNon-null immutable owner; caller may retain another owner for retry.
Returns
QUEUED on admission, CLOSED after cancellation/delivery, WOULD_BLOCK for a full queue or duplicate accepted completion, INVALID_ARGUMENT for null, or NO_MEMORY.

◆ fail()

template<class T>
std::expected< PublishResult, AsyncError > portals::AsyncReply< T >::fail ( AsyncError error) const
inline
Parameters
errorTyped provider failure delivered as the await result.
Returns
Same queue/admission result as complete(); failed admission remains retryable.

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