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
Required Methods§
Sourcefn tx_id(&self) -> u64
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.
Sourcefn push(&mut self, changes: Arc<[Captured]>)
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).
Sourcefn finish(self: Box<Self>) -> Box<dyn FanoutGate>
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§
Sourcefn await_acks(&mut self) -> bool
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.