pub struct SigFirstSub { /* private fields */ }Expand description
Live sig-first subscription. Call SigFirstSub::next in a loop.
A background task drains the connection as fast as the network delivers.
When a slow next loop fills the queue, the oldest items are evicted and
counted by SigFirstSub::dropped. SigFirstSub::gaps is a separate,
provisional counter for
sequence numbers that appear not to have arrived (network loss, a shed
delivery — or merely reordering, which it cannot tell apart), as opposed to
dropped, which counts items that definitely arrived and were evicted
because this consumer fell behind.
Implementations§
Source§impl SigFirstSub
impl SigFirstSub
Sourcepub async fn next(&mut self) -> Result<Option<SigFirstItem>>
pub async fn next(&mut self) -> Result<Option<SigFirstItem>>
Awaits the next SigFirstItem. A QUIC application close is returned
as Error::ApplicationClosed, including normal close code 0;
Ok(None) is reserved for a locally ended drain with no terminal error.
Do the work for each item elsewhere. Time spent between two calls is
queue depth, and past SIG_QUEUE_LEN it is loss.
Sourcepub fn dropped(&self) -> u64
pub fn dropped(&self) -> u64
Items evicted because this consumer fell behind. Watch it: no kernel or NIC counter will show this loss.
Sourcepub fn gaps(&self) -> u64
pub fn gaps(&self) -> u64
A provisional loss indicator: item-to-item seq gaps plus
trailing loss revealed by a heartbeat’s highest_seq.
NO_SEQ_ASSIGNED on the wire never contributes to this counter.
It can over-report under reordering. QUIC DATAGRAMs are unordered
by definition, so a scalar high-watermark cannot distinguish “this seq
is late” from “this seq is lost” at the moment a later one arrives out
of order — it charges one provisional gap on that jump, and never
reverses the charge if the late item shows up afterward. A perfectly
lossless but reordered stream can therefore report gaps() > 0. Treat
this as “loss happened, or reordering did” rather than an exact count
of sequence numbers that never arrived on the wire at all.
Sourcepub async fn update_filter(&self, filter: &Filter) -> Result<Ack>
pub async fn update_filter(&self, filter: &Filter) -> Result<Ack>
Updates the active filter live (opens a fresh control stream) and
returns the server’s parsed ack. Enrichment fields do not exist on the
sig-first tier, so this always sends an empty fields list. The tier
cannot change after the first control message.