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

Copyable worker token. Dispatch load() through the existing background executor. The library owns no worker/runtime. Copies share cancellation and one reservation; final release returns capacity after the provider, workspace, results and queued owners have stopped using it. More...

#include <window_source.hpp>

Public Member Functions

 WindowRequest ()=default
 Empty cancelled request.
SourceReadCommand command () const noexcept
bool stopRequested () const noexcept
void cancel () const noexcept
 Cooperative cancellation only; does not release shared capacity or join. Registered stop callbacks execute synchronously and must be short and worker-safe.
std::expected< SourceReadReply< T >, SourceError > load (std::stop_token external={}) const
std::expected< PublishResult, SchedulerError > complete (const std::expected< SourceReadReply< T >, SourceError > &reply) const

Friends

struct detail::WindowRequestAccess
template<class>
class WindowConsumer

Detailed Description

template<class T>
class portals::WindowRequest< T >

Copyable worker token. Dispatch load() through the existing background executor. The library owns no worker/runtime. Copies share cancellation and one reservation; final release returns capacity after the provider, workspace, results and queued owners have stopped using it.

Template Parameters
TImmutable worker-destructible row value.

Member Function Documentation

◆ command()

template<class T>
SourceReadCommand portals::WindowRequest< T >::command ( ) const
inlinenoexcept
Returns
Immutable command; a default token has a zero command.

◆ complete()

template<class T>
std::expected< PublishResult, SchedulerError > portals::WindowRequest< T >::complete ( const std::expected< SourceReadReply< T >, SourceError > & reply) const
inline
Parameters
replyOwning load result; retry the same result after WOULD_BLOCK/NO_MEMORY.
Returns
Existing queue admission, never UI application; one accepted publication per generation.

◆ load()

template<class T>
std::expected< SourceReadReply< T >, SourceError > portals::WindowRequest< T >::load ( std::stop_token external = {}) const
inline
Parameters
externalOptional host cancellation, combined with this request's cancellation.
Returns
Owning reply/error. UI invocation is rejected; each token generation loads once.

◆ stopRequested()

template<class T>
bool portals::WindowRequest< T >::stopRequested ( ) const
inlinenoexcept
Returns
True after cancellation/source closure or for an empty token.

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