Expand description
Subscription write gates and pending snapshot lifetimes.
SnapshotGateprevents snapshot acceptance while a replacement subscription is being sent.PendingSnapshotowns the cancellation token, gate, and optional deadline for a pending snapshot. Removing it cancels the associated wait.snapshot_expiredwaits for a snapshot deadline or cancellation. A zero timeout disables monitoring.
§Snapshot Lifecycle
Gates start open. The adapter closes a gate before a guarded write and opens it only after the intended connection confirms that write. Snapshot acceptance checks the gate under its lock.
An adapter can keep an absolute deadline for monitoring or await snapshot_expired after
write confirmation. Accepting a snapshot or retiring its subscription drops the pending owner,
cancelling obsolete work.
§Adapters
The adapter verifies sequence validity and any subscription-generation correlation. The gate alone cannot identify which request or connection produced a snapshot.
Scheduling waits and starting recovery remain adapter responsibilities.
Structs§
- Pending
Snapshot - Pending snapshot ownership, cancelled on acceptance, replacement, or removal.
- Snapshot
Gate - Coordinates subscription sends with snapshot acceptance.
- Snapshot
Gate Guard - Locked snapshot acceptance gate.
Functions§
- snapshot_
expired - Returns whether the snapshot deadline expires before cancellation.