pub struct PipelineRuntime<S>where
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> PipelineRuntime<S>where
S: Source + 'static,
impl<S> PipelineRuntime<S>where
S: Source + 'static,
Sourcepub fn new(
config: PipelineConfig,
source: S,
chains: impl FnMut(usize) -> Box<dyn RunnableChain> + Send + 'static,
sink: SinkRuntime,
budget: Arc<InflightBudget>,
) -> PipelineRuntime<S>
pub fn new( config: PipelineConfig, source: S, chains: impl FnMut(usize) -> Box<dyn RunnableChain> + Send + 'static, sink: SinkRuntime, budget: Arc<InflightBudget>, ) -> PipelineRuntime<S>
Assemble a runtime. chains builds one erased chain per pipeline
thread (thread index in).
Sourcepub fn with_options(self, options: RuntimeOptions) -> PipelineRuntime<S>
pub fn with_options(self, options: RuntimeOptions) -> PipelineRuntime<S>
Override runtime options (returns self for chaining).
Sourcepub fn with_io_runtime(self, io: Runtime) -> PipelineRuntime<S>
pub fn with_io_runtime(self, io: Runtime) -> PipelineRuntime<S>
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.
Trait Implementations§
Auto Trait Implementations§
impl<S> !Freeze for PipelineRuntime<S>
impl<S> !RefUnwindSafe for PipelineRuntime<S>
impl<S> Send for PipelineRuntime<S>
impl<S> !Sync for PipelineRuntime<S>
impl<S> Unpin for PipelineRuntime<S>where
S: Unpin,
impl<S> UnsafeUnpin for PipelineRuntime<S>where
S: UnsafeUnpin,
impl<S> !UnwindSafe for PipelineRuntime<S>
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more