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

Borrowed host service. A scene never owns, stops or joins this executor. UI integration calls service once per existing application cycle, after scheduler dispatch. A ready host must keep scheduling steps while work is pending; wake only signals the existing scheduler condition and does not interrupt native terminal reads or schedule a foreign event loop. More...

#include <background.hpp>

Inheritance diagram for portals::BackgroundExecutor:
portals::BackgroundExecutorportals::BackgroundExecutor portals::BackgroundPool

Public Member Functions

virtual ~BackgroundExecutor ()=default
 Concrete owning executors define their final join boundary.
virtual std::expected< BackgroundTicket, BackgroundError > submit (std::unique_ptr< BackgroundJob > &job)=0
virtual void service () noexcept=0
 Permit one publication retry per blocked worker; does not wait or invoke UI callbacks.
virtual std::uint64_t capacityEpoch () const noexcept=0
virtual BackgroundWorkerStorage * workerStorage () noexcept

Detailed Description

Borrowed host service. A scene never owns, stops or joins this executor. UI integration calls service once per existing application cycle, after scheduler dispatch. A ready host must keep scheduling steps while work is pending; wake only signals the existing scheduler condition and does not interrupt native terminal reads or schedule a foreign event loop.

Member Function Documentation

◆ capacityEpoch()

virtual std::uint64_t portals::BackgroundExecutor::capacityEpoch ( ) const
pure virtualnoexcept
Returns
Advisory capacity generation, sampled before submit to avoid a missed release race.

Implemented in portals::BackgroundPool.

◆ service()

virtual void portals::BackgroundExecutor::service ( )
pure virtualnoexcept

Permit one publication retry per blocked worker; does not wait or invoke UI callbacks.

Implemented in portals::BackgroundPool.

◆ submit()

virtual std::expected< BackgroundTicket, BackgroundError > portals::BackgroundExecutor::submit ( std::unique_ptr< BackgroundJob > & job)
pure virtual
Parameters
jobOwning worker-safe item; preserved on any rejected admission.
Returns
Cancellation owner on acceptance, or explicit admission failure.

Implemented in portals::BackgroundPool.

◆ workerStorage()

virtual BackgroundWorkerStorage * portals::BackgroundExecutor::workerStorage ( )
inlinevirtualnoexcept
Returns
Optional opaque worker-cache capability, borrowed for this executor's lifetime. Unsupported hosts return nullptr; no synchronous UI-owned cache fallback is permitted.

Reimplemented in portals::BackgroundPool.


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