Skip to main content

Module cdc

Module cdc 

Source
Expand description

Durable change-feed (CDC) — issue #824 (CDC epic #692, Phase 5c).

This mirrors the canonical Python consumer (#823, Phase 5b) with identical semantics: Kafka-style client-managed committed offsets, a pluggable CheckpointStore with a file-backed atomic default (FileCheckpointStore), bootstrap-on-compacted (paged Scan baseline then resume from snapshot_offset + 1), heartbeat-advances-checkpoint, reconnect-on-disconnect from last_offset + 1, and at-least-once delivery with idempotency required on the boundary.

Structs§

CommittedChange
A single change delivered by crate::StateletClient::subscribe_committed.
FileCheckpointStore
Default CheckpointStore backed by an atomically-written JSON file.
SubscribeCommittedOptions
Configuration for crate::StateletClient::subscribe_committed.
TokioSleeper
Default tokio-backed Sleeper.

Enums§

ConsumeError
Error returned by the consumer driver: either a transport error or an error from the user’s handler / checkpoint store.
FeedItem
One item received from the committed feed stream — the SDK-level mirror of proto::committed_feed_item::Item.

Traits§

CheckpointStore
Pluggable store for a consumer’s last fully-processed CDC offset.
FeedStream
A source of committed-feed items for one server-streaming connection.
FeedTransport
Transport abstraction used by the consumer driver: open a feed stream and page a scan. The real crate::StateletClient implements this over gRPC; tests provide a fake.
Sleeper
Hook used by the driver to wait between reconnect attempts. The default sleeps via tokio; tests override it to avoid real delays.

Functions§

run_consumer
Run the durable change-feed consumer driving the canonical Phase-5b algorithm. This is generic over the FeedTransport so it is unit-testable without a live server; crate::StateletClient::subscribe_committed is the public entry point wrapping the gRPC transport.