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

Move-only cancellation ownership; destruction requests cancellation but never joins. More...

#include <background.hpp>

Public Member Functions

 BackgroundTicket ()=default
 Empty inactive ticket.
 ~BackgroundTicket ()
 Request cancellation; never wait for a worker.
 BackgroundTicket (BackgroundTicket &&other) noexcept
BackgroundTicket & operator= (BackgroundTicket &&other) noexcept
 BackgroundTicket (const BackgroundTicket &)=delete
BackgroundTicket & operator= (const BackgroundTicket &)=delete
 BackgroundTicket (std::weak_ptr< BackgroundJob > job)
void cancel () noexcept
 Request cooperative cancellation; stop callbacks must return promptly. This retires work without publishing a completion. Its UI owner must also cancel/retire the waiter.

Detailed Description

Move-only cancellation ownership; destruction requests cancellation but never joins.

Constructor & Destructor Documentation

◆ BackgroundTicket() [1/2]

portals::BackgroundTicket::BackgroundTicket ( BackgroundTicket && other)
noexcept
Parameters
otherCancellation owner to transfer and empty.

◆ BackgroundTicket() [2/2]

portals::BackgroundTicket::BackgroundTicket ( std::weak_ptr< BackgroundJob > job)
inlineexplicit
Parameters
jobAccepted worker-safe owner, observed without prolonging its completed lifetime. Host executors may construct the same cancellation owner after their own admission.

Member Function Documentation

◆ operator=()

BackgroundTicket & portals::BackgroundTicket::operator= ( BackgroundTicket && other)
noexcept
Parameters
otherCancellation owner replacing this one after cancellation.
Returns
This owner; self-assignment is a no-op.

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