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

UI-owned latest source; the executor and its host outlive this holder. Existing scene integration services this holder after dispatch. Replacement cancels the previous ticket and replaces only this source's rejected intent. No self-post or inline UI continuation occurs. This bounds count to one unadmitted intent per source; callers enforce their input byte budgets. More...

#include <background.hpp>

Public Member Functions

 BackgroundLatest (BackgroundExecutor &executor)
 ~BackgroundLatest ()
 Cancel this source's admitted work without stopping the borrowed executor.
 BackgroundLatest (const BackgroundLatest &)=delete
BackgroundLatest & operator= (const BackgroundLatest &)=delete
std::expected< BackgroundAdmission, BackgroundError > replace (std::unique_ptr< BackgroundJob > job)
std::expected< BackgroundAdmission, BackgroundError > service ()
void cancel () noexcept
 Cancel admitted work and release the latest unadmitted intent; no worker join.

Detailed Description

UI-owned latest source; the executor and its host outlive this holder. Existing scene integration services this holder after dispatch. Replacement cancels the previous ticket and replaces only this source's rejected intent. No self-post or inline UI continuation occurs. This bounds count to one unadmitted intent per source; callers enforce their input byte budgets.

Constructor & Destructor Documentation

◆ BackgroundLatest()

portals::BackgroundLatest::BackgroundLatest ( BackgroundExecutor & executor)
inlineexplicit
Parameters
executorBorrowed service, retained until this holder is destroyed.

Member Function Documentation

◆ replace()

std::expected< BackgroundAdmission, BackgroundError > portals::BackgroundLatest::replace ( std::unique_ptr< BackgroundJob > job)
Parameters
jobOwning new intent; cancellation/replacement destroys only worker-safe captures.
Returns
STARTED, RETAINED on bounded admission refusal, or the exact terminal admission error.

◆ service()

std::expected< BackgroundAdmission, BackgroundError > portals::BackgroundLatest::service ( )
Returns
Retry after capacity changed, or STARTED when no unadmitted intent remains.

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