pub struct PipelineRuntime<S: Source> { /* private fields */ }Expand description
One pipeline process: source, per-thread chains, and a sink, assembled
per docs/DESIGN.md § Process anatomy.
The caller creates the shared InflightBudget first and wires it into
the chain terminals (which add on enqueue) and the sink workers (which
sub on durable write or abandonment) before handing everything here.
Implementations§
Source§impl<S: Source + 'static> PipelineRuntime<S>
impl<S: Source + 'static> PipelineRuntime<S>
Sourcepub fn new(
config: PipelineConfig,
source: S,
chains: impl FnMut(usize) -> Box<dyn RunnableChain> + Send + 'static,
sink: SinkRuntime,
budget: Arc<InflightBudget>,
) -> Self
pub fn new( config: PipelineConfig, source: S, chains: impl FnMut(usize) -> Box<dyn RunnableChain> + Send + 'static, sink: SinkRuntime, budget: Arc<InflightBudget>, ) -> Self
Assemble a runtime. chains builds one erased chain per pipeline
thread (thread index in).
Sourcepub fn with_options(self, options: RuntimeOptions) -> Self
pub fn with_options(self, options: RuntimeOptions) -> Self
Override runtime options (returns self for chaining).
Sourcepub fn with_io_runtime(self, io: Runtime) -> Self
pub fn with_io_runtime(self, io: Runtime) -> Self
Use a caller-owned tokio runtime as the I/O runtime instead of
building one inside run — for assemblies whose
connectors needed a handle before the runtime existed (sink workers
spawned at construction, schema-registry fetchers, async pre-flight
validation). run shuts it down on exit exactly as it does the
internally built one; connector tasks spawned on it earlier keep
running until then. Without this, assemblies end up running a
second runtime, doubling pipeline.io_threads.
Sourcepub fn shutdown_handle(&self) -> ShutdownHandle
pub fn shutdown_handle(&self) -> ShutdownHandle
A handle that triggers a graceful drain.
Sourcepub fn run(self) -> Result<ExitReport, StartError>
pub fn run(self) -> Result<ExitReport, StartError>
Run the pipeline to completion (blocking). Returns when the pipeline drained after a shutdown trigger/signal or failed.