Skip to main content

Stream

Trait Stream 

Source
pub trait Stream:
    Debug
    + Send
    + Sync {
    // Required methods
    fn lane(&self, sink: &SinkName) -> Result<Lane>;
    fn requests(&self) -> Result<RequestLane>;
    fn watermark(&self) -> Option<Position>;
    fn is_idle(&self) -> bool;
}
Expand description

The stream port: one lane per sink downward, one request lane upward, and the watermark that ties every lane’s acknowledgements together.

lane and requests are idempotent: calling them again returns fresh ends over the same lane, which is how the daemon re-attaches a restarted engine (the previous consumer’s unacknowledged item is redelivered to the new one).

Required Methods§

Source

fn lane(&self, sink: &SinkName) -> Result<Lane>

The lane for sink. An unknown sink is an error: the set of lanes is fixed when the stream is built.

Source

fn requests(&self) -> Result<RequestLane>

The request lane.

Source

fn watermark(&self) -> Option<Position>

The lowest position every lane has acknowledged: what the source may confirm. None until every lane has acknowledged a positioned batch.

Source

fn is_idle(&self) -> bool

Whether every lane is drained: nothing queued and nothing delivered but unacknowledged. The daemon waits for this before it stops the sink engines after the source stream ended.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§