Expand description
Bounded append-only record of published events, per view.
The entity cache is a latest-state projection: deep_merge_with_append
folds each patch into the resident entity, so an intermediate occurrence is
unrecoverable however large the cache is. Resuming a consumer therefore
cannot be served from it — a replayable subscription needs the events
themselves, kept in arrival order.
§Cursors
Each view has its own dense monotonic offset, assigned here at append time.
The wire _seq ({slot}:{slot_index:012}) is deliberately not used as
the replay cursor: slot_index is txn_index for instruction updates, so
every event decoded from one transaction shares it and “replay each
occurrence exactly once” is not expressible. An append-assigned offset is
unique and gap-free by construction.
A cursor is {epoch}:{offset}. The epoch identifies one tape lifetime.
Offsets restart at zero whenever a tape is built without restoring one
(snapshots disabled, a rejected or corrupt blob, any cold start), and dense
offsets make a stale cursor indistinguishable from a live one — so without
the epoch, a cursor from a previous lifetime would eventually land inside
the new window and replay unrelated events as a continuation. The epoch
makes that fail closed.
Offsets are per view and are not comparable across views.
Structs§
- Cursor
- A cursor as it travels on the wire:
{epoch}:{offset}. - Event
Journal - Per-view append-only event log with bounded retention.
- Journal
Config - Retention bounds for the event journal. Whichever bound bites first wins.
- Journal
Epoch - Identifies one tape lifetime, so a cursor minted by a previous one cannot be mistaken for a live offset.
- Journal
Record - One published event, retained verbatim.
- Journal
Snapshot - The retained tape for every view, carried in the snapshot payload.
- Persisted
Record - Durable form of one retained record.
- Persisted
View Journal - Replay
Window - The offsets a view can currently serve.
Enums§
- Replay
Error - Why a replay could not be served.
Functions§
- mark_
stream_ gap - Called by the generated runtime when it starts the stream live over a hole, so a replay across that hole is refused instead of served as an unbroken continuation.