Skip to main content

Module source

Module source 

Source
Expand description

Source abstraction: a control plane (Source) and a data plane (SourceLane).

A source is poll-based — no futures::Stream. The control plane surfaces lane assignment and revocation as events and owns commits and pause/resume; each lane is a pollable unit pinned to one pipeline thread (for Kafka: a partition queue), yielding payloads that borrow the source’s buffers for the duration of one push_batch call. See docs/DESIGN.md (§ Source abstraction, § Frozen v1 contracts).

Structs§

DrainBarrier
A countdown barrier the controller waits on while pipeline threads drain. Created with the number of arriving parties (the threads that own the lanes being stopped); each thread calls DrainBarrier::arrive exactly once after it has stopped the lanes and flushed its in-flight records; the controller’s DrainBarrier::wait returns true once all parties arrived, or false on timeout (drain deadline exceeded — the caller proceeds and unflushed data replays after restart; at-least-once holds either way).
LaneId
Identifier of one source lane within an assignment (dense, source-assigned; stable until the lane is revoked).
SourceCtx
Everything a source receives at Source::open.

Enums§

SourceEvent
Control-plane event returned by Source::poll_events.

Traits§

PayloadBatch
One poll’s worth of borrowed payloads. Streaming — payloads are handed out one at a time, and every payload shares the batch lifetime 'buf. The batch carries exactly one AckRef, issued by the lane through its AckIssuer; records derived from these payloads clone it.
Source
Control plane of a source. Driven by the runtime’s controller from a single thread; lanes run on pipeline threads.
SourceLane
Data-plane pollable unit of a source, owned by one pipeline thread.