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ยง
- Delivery
Stopped - Returned when an update did not run because the delivery has stopped.
- Drop
Decided - The marker of an
UpdateOutcomethat has decided, carrying the value to drop, if any. - Drop
Undecided - The marker of an
UpdateOutcomethat has not decided what to drop outside the lock yet. - Serialized
Delivery - A shared, serialized delivery of events to one observer.
- Update
Outcome - 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.
- Weak
Serialized Delivery - A non-owning reference to a
SerializedDelivery.