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§
Sourcefn on_batch_end(&mut self, elapsed: Duration)
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.
Sourcefn take_fatal(&mut self) -> Option<FatalError>
fn take_fatal(&mut self) -> Option<FatalError>
Take the first fatal error recorded by any stage.
Sourcefn relieve(&mut self) -> Flow
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.
Sourcefn flush_terminal(&mut self) -> Flow
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.