Skip to main content

SourceLane

Trait SourceLane 

Source
pub trait SourceLane: Send {
    type Batch<'a>: PayloadBatch<'a>
       where Self: 'a;

    // Required methods
    fn id(&self) -> LaneId;
    fn partition(&self) -> PartitionId;
    fn poll(
        &mut self,
        max_records: usize,
        timeout: Duration,
    ) -> Result<Option<Self::Batch<'_>>, SourceError>;
}
Expand description

Data-plane pollable unit of a source, owned by one pipeline thread.

Contract: payloads yielded by SourceLane::poll are valid only until the returned batch is dropped, which happens before the next poll call on the same lane — records must be consumed or encoded within that window (the operator chain guarantees this by construction).

Required Associated Types§

Source

type Batch<'a>: PayloadBatch<'a> where Self: 'a

The borrowed batch type (a GAT so payloads can borrow lane buffers).

Required Methods§

Source

fn id(&self) -> LaneId

This lane’s identity within the current assignment.

Source

fn partition(&self) -> PartitionId

The source partition this lane reads. Used for checkpoint issuing and shard routing fallback.

Source

fn poll( &mut self, max_records: usize, timeout: Duration, ) -> Result<Option<Self::Batch<'_>>, SourceError>

Poll up to max_records payloads, waiting at most timeout. Ok(None) means nothing arrived — the driver treats it as idle. Implementations must not busy-spin when idle: block up to timeout.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§