Skip to main content

StageLifecycle

Trait StageLifecycle 

Source
pub trait StageLifecycle {
    // Required methods
    fn on_batch_end(&mut self, elapsed: Duration);
    fn take_fatal(&mut self) -> Option<FatalError>;
    fn relieve(&mut self) -> Flow;
    fn flush_terminal(&mut self) -> Flow;
}
Expand description

Per-batch lifecycle cascade implemented by every stage. Combinators handle their own concern and delegate downstream; the terminal stage anchors the recursion.

Required Methods§

Source

fn on_batch_end(&mut self, elapsed: Duration)

Flush per-batch metric accumulators. elapsed is the chain-level batch duration: per-stage attribution inside one inlined loop is not measurable without per-record clocks, so every stage reports the chain figure, keeping the histograms comparable.

Source

fn take_fatal(&mut self) -> Option<FatalError>

Take the first fatal error recorded by any stage.

Source

fn relieve(&mut self) -> Flow

Let the terminal stage drain parked output. Flow::Blocked means it is still backed up and the chain must not accept new payloads.

Source

fn flush_terminal(&mut self) -> Flow

Seal and hand off all terminal buffers, partial chunks included. Flow::Blocked means not everything could be sent; retry later.

Implementors§

Source§

impl<F, E, R> StageLifecycle for SinkHandoff<F, E, R>
where F: RecFamily, E: RowEncoder<F> + Clone,

Source§

impl<G, N> StageLifecycle for Inspect<G, N>
where N: StageLifecycle,

Source§

impl<G, N> StageLifecycle for Map<G, N>
where N: StageLifecycle,

Source§

impl<G, N> StageLifecycle for TryMap<G, N>
where N: StageLifecycle,

Source§

impl<OutF, G, N> StageLifecycle for FlatMap<OutF, G, N>
where OutF: RecFamily, N: StageLifecycle,

Source§

impl<P, N> StageLifecycle for Filter<P, N>
where N: StageLifecycle,