Expand description
What flows through the stream: the position in the source’s change feed and the envelope a lane carries for one document.
A Position is assigned by the source, monotonic for the life of the
source instance (across reopened streams, so a restarted ingest engine
never reuses one), and meaningful only to the source that issued it (the Postgres adapter maps it
back to an LSN). The stream orders positions to compute its watermark; the
ingest engine hands the watermark back to the source as confirmation.
An Envelope is one document operation as every sink receives it: the
index, the operation, the document id, the document itself (absent on a
delete), the position of the change that produced it (absent for a snapshot
row, seq on the wire), when it was built, and — stamped on the sink side —
the emitting sink’s name and a meta summary. Emitting sinks forward it
as-is; a consumer deserializes the same type over its own document type.
use kernel::{Envelope, Op, Position};
let position = Position(42);
assert_eq!(position.to_string(), "42");
assert!(Position(41) < position);
let json = serde_json::to_string(&Op::Upsert).unwrap();
assert_eq!(json, "\"upsert\"");Structs§
- Envelope
- One document operation as a lane carries it and a sink receives it.
- Envelope
Meta - At-a-glance facts about a serialized document.
- Position
- An offset in the source’s change feed: opaque to everyone but the source, ordered so the stream can take a minimum across lanes.
Enums§
- Op
- What happened to the document.
Constants§
- ENVELOPE_
VERSION - The envelope format version, bumped when a field changes meaning.