Skip to main content

Module source

Module source 

Source
Expand description

Streaming Source API.

A Source is the entry point for data into a streaming pipeline. It wraps a channel producer with a type-safe interface and supports:

  • Push individual records or batches
  • Push Arrow RecordBatch directly
  • Watermark emission for event-time processing
  • Automatic SPSC → MPSC upgrade on clone

§Usage

use laminar_core::streaming::{Source, SourceConfig};

// Create a source
let (source, sink) = streaming::create::<MyEvent>(config);

// Push records
source.push(event)?;
source.push_batch(&events)?;

// Emit watermark
source.watermark(timestamp);

// Clone for multi-producer (triggers MPSC upgrade)
let source2 = source.clone();

Structs§

Source
A streaming data source.

Traits§

Record
Trait for types that can be streamed through a Source.

Functions§

create
Creates a new Source/Sink pair with default configuration.
create_with_config
Creates a new Source/Sink pair with custom configuration.