class SchedulerTicket

Tickets allow you to schedule sequential execution of tasks.

Tickets are retrieved from the SchedulerTicketQueue, and can be in three states: Waiting, Called and Done.

First ticket taken from the queue will be in Called state. Any subsequent tickets will be in Waiting state. Once we call Done() on the ticket, the ticket is sent to Done state, and next ticket in line is moved from Waiting to Called state.

Each ticket can have an associated callback, which will trigger when a ticket is Called.

Public

Constructors

SchedulerTicket

SchedulerTicket() = default

SchedulerTicket

SchedulerTicket(const SchedulerTicket &other) = default

SchedulerTicket

SchedulerTicket(SchedulerTicket &&other) = default

Methods

WaitUntilCalled

void WaitUntilCalled() const

Blocks calling code until the ticket is out of the Waiting state.

TransitionToDoneState

void TransitionToDoneState() const

Moves the ticket into Done state.

Should only be called on tickets that have been Called.

DoWhenCalled

void DoWhenCalled(Function<void ()> &&callback) const

Registers a callback that will trigger when the ticket triggers.

Multiple callbacks can be registered, in which case they will trigger in the order they were registered.

Operators

operator=

SchedulerTicket &operator=(const SchedulerTicket &other) = default

operator=

SchedulerTicket &operator=(SchedulerTicket &&other) = default

Private

Constructors

SchedulerTicket

SchedulerTicket(SPtr<SchedulerTicketData> &&record)

Fields

mData