pub struct GlobalProjectionCheckpoint {
pub cursors: BTreeMap<StreamId, u64>,
}Expand description
Per-stream sequence number cursors for multi-stream projections.
Returned by ProjectionRunner::run_all_streams and
ProjectionRunner::catch_up_all_streams. Pass an existing checkpoint
to catch_up_all_streams so only events newer than the last replay are
fed to the projection.
Persist this value (e.g. alongside the read model in a snapshot store) to survive process restarts and avoid full replays on restart.
A cursor value of 0 for a stream means “never seen” (equivalent to
“replay from the beginning”).
Fields§
§cursors: BTreeMap<StreamId, u64>Last-processed sequence number per stream identifier.
Streams not present in this map have an implicit cursor of 0.
Implementations§
Source§impl GlobalProjectionCheckpoint
impl GlobalProjectionCheckpoint
Sourcepub fn cursor_for(&self, stream_id: &StreamId) -> u64
pub fn cursor_for(&self, stream_id: &StreamId) -> u64
The last-processed sequence number for stream_id.
Returns 0 when the stream has never been processed (signals a full
replay is needed for that stream).
Trait Implementations§
Source§impl Clone for GlobalProjectionCheckpoint
impl Clone for GlobalProjectionCheckpoint
Source§fn clone(&self) -> GlobalProjectionCheckpoint
fn clone(&self) -> GlobalProjectionCheckpoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more