Rindle docs and package mapSkip to main content

FanoutStream

Trait FanoutStream 

Source
pub trait FanoutStream {
    // Required methods
    fn tx_id(&self) -> u64;
    fn push(&mut self, changes: Arc<[Captured]>);
    fn finish(self: Box<Self>) -> Box<dyn FanoutGate>;

    // Provided method
    fn await_acks(&mut self) -> bool { ... }
}
Expand description

One in-flight transaction’s fan-out: bounded push chunks, then a terminal finish handing back the commit-verdict gate. Dropping it without finish is an abort — the implementation must release anything it pinned.

Required Methods§

Source

fn tx_id(&self) -> u64

The transaction id this stream was opened for — carried on the stream so a lazily-opened mid-transaction fan-out keeps its cursor without recomputation.

Source

fn push(&mut self, changes: Arc<[Captured]>)

Forward one bounded chunk (≤ PUSH_CHUNK_ROWS rows, one shared Arc — a refcount bump, never a row copy). May block for backpressure; must not fail (a lost observer is the implementation’s business to repair at finish).

Source

fn finish(self: Box<Self>) -> Box<dyn FanoutGate>

Close the push stream and return the gate the caller releases after (or instead of) the durable COMMIT.

Provided Methods§

Source

fn await_acks(&mut self) -> bool

Collect the begin-barrier acks sent back since CommitFanout::tx_begin — the fence that must pass before the caller’s durable COMMIT makes the transaction visible (an observer pinning late would see a base that already contains it). Called at the commit edge, after the last push; in the common case the acks arrived while the caller ran its own statements and nothing parks. false ⇒ an observer died or stayed stuck past the fence’s watchdog: the caller must NOT commit — finish with an abort, recover_failed_begin, and fail the write. Headless observers have no acks to collect; the default always passes.

Implementors§