Expand description
Delta buffering for sync scenarios (Invariant I6).
When a snapshot sync is in progress, incoming deltas are buffered so they can be replayed after the snapshot completes. This ensures that:
- Deltas arriving during sync aren’t lost (Invariant I6 - Liveness Guarantee)
- Event handlers can execute for buffered deltas after context is initialized
§Delivery Contract
- Buffer size: Configurable, default 10,000 deltas per context
- Drop policy: Oldest-first when buffer full (with metric increment)
- Backpressure: None (fire-and-forget from network layer)
- Metrics:
dropscounter MUST be observable
§Minimum Capacity Warning
If buffer capacity is set below MIN_RECOMMENDED_CAPACITY, a warning should
be logged at startup. Zero capacity is valid but will drop ALL deltas.
Structs§
- Buffered
Delta - A single buffered delta.
- Delta
Buffer - Buffer for storing deltas during snapshot sync.
Enums§
- Push
Result - Result of pushing a delta to the buffer.
Constants§
- DEFAULT_
BUFFER_ CAPACITY - Default buffer capacity (10,000 deltas per context).
- MIN_
RECOMMENDED_ CAPACITY - Minimum recommended buffer capacity.