Skip to main content

RunnableChain

Trait RunnableChain 

Source
pub trait RunnableChain: Send {
    // Required methods
    fn push_batch<'buf>(
        &mut self,
        batch: &mut dyn PayloadBatch<'buf>,
        from: usize,
    ) -> PushOutcome;
    fn flush(&mut self) -> PushOutcome;

    // Provided method
    fn abandon_batch(&mut self) { ... }
}
Expand description

THE SEAM — the one erasure boundary between a pipeline thread’s driver loop and a typed chain. The methods are generic over the buffer lifetime only, so Box<dyn RunnableChain> is legal.

Required Methods§

Source

fn push_batch<'buf>( &mut self, batch: &mut dyn PayloadBatch<'buf>, from: usize, ) -> PushOutcome

Push payloads from.. of batch through the chain.

Source

fn flush(&mut self) -> PushOutcome

Flush terminal-stage state (parked records, partial encoder buffers) downstream. Called by the driver on drain, on linger deadlines, and before commit ticks.

Provided Methods§

Source

fn abandon_batch(&mut self)

Discard any per-batch replay/resume state after the driver failed the current batch’s acknowledgement (a shutdown-time abandonment of a batch blocked mid-push). Terminal parked chunks — which carry their own acks — are unaffected; only the chain’s own mid-batch cursor and any stashed not-ready payload are cleared, so the next push_batch of a fresh batch starts clean instead of tripping the resume-cursor asserts or replaying the stale payload under the new batch’s ack.

The default is a no-op for chains that keep no cross-call batch state.

Implementors§

Source§

impl<F, D, Ops> RunnableChain for TypedChain<F, D, Ops>
where F: RecFamily, D: Deserializer<F>, Ops: for<'buf> Collector<<F as RecFamily>::Rec<'buf>> + StageLifecycle + Send,