Expand description
Per-topic ring buffer for captured events.
Each TopicRing is bounded in capacity. When a push would exceed
capacity, the oldest event is evicted (FIFO). Cursors are server-
assigned monotonically within (topic, reset_epoch) — they never
collide as long as reset_epoch is unique per process run, and they
never reset within a single run (so client cursor comparisons stay
cheap).
The ring is read by cursor: read_since(cursor, limit) returns events
whose cursor is strictly greater than cursor, up to limit. If the
caller’s cursor is older than the buffer’s current head (the smallest
cursor still buffered), the read returns ReadResult::CursorExpired
so the client can resync to head and emit a synthetic gap event.
Structs§
- Topic
Ring - FIFO ring of
ObservedEventkeyed by cursor. Single owner; notSend + Syncon its own — wrap inArc<RwLock<…>>for cross-task access.
Enums§
- Read
Result - Outcome of
TopicRing::read_since.