Expand description
Cursor-based event streaming — enables downstream consumers to subscribe to indexed events with resumable, at-least-once delivery.
Consumers maintain a cursor (position) and can resume from where they left off after crashes or restarts. Each consumer tracks its own independent cursor, so multiple consumers can process the same event stream at different rates.
§Architecture
Indexer ──push()──> EventStream ──next_batch()──> Consumer A
│ Consumer B
│ Consumer C
└── ring buffer (bounded)§Reorg Handling
When a chain reorganization is detected, call invalidate_after(block_number)
to remove all events at or above that block and bump the stream version.
Consumers holding cursors with an older version must re-fetch from a
known-good position.
Structs§
- Event
Batch - A batch of events returned to a consumer.
- Event
Stream - In-memory event stream buffer that supports multiple consumers.
- Stream
Config - Configuration for event streaming.
- Stream
Cursor - An opaque cursor representing a position in the event stream.