Skip to main content

Module serialized_delivery

Module serialized_delivery 

Source
Expand description

The state machine that serializes the events delivered to one observer, together with the lock that guards it and the only operations allowed to drive it.

SerializedDelivery is a shared handle. Its lock never leaves this module, so a host cannot hold it across a notification, a drop, or a second lock: every transition, the delivery loop, and the rule that nothing is dropped or notified under the lock live here.

A host that must change its own data, and emit the resulting events atomically, does so through SerializedDelivery::update, which runs its callback under the same lock that then queues the events. The callback describes its outcome with an UpdateOutcome, the one way to hand this module events to queue and a value to drop once they were delivered.

Structsยง

DeliveryStopped
Returned when an update did not run because the delivery has stopped.
DropDecided
The marker of an UpdateOutcome that has decided, carrying the value to drop, if any.
DropUndecided
The marker of an UpdateOutcome that has not decided what to drop outside the lock yet.
SerializedDelivery
A shared, serialized delivery of events to one observer.
UpdateOutcome
What an update performed under the lock produced: the events to queue, a value to drop once they were delivered, and the result to give back to the caller.
WeakSerializedDelivery
A non-owning reference to a SerializedDelivery.