pub struct SubMonitorCell {
pub max_age_ms: AtomicU32,
pub takes: AtomicU32,
pub deadline_slot: AtomicU32,
pub arrivals: AtomicU32,
}Expand description
One contracted subscriber’s take-age accumulator (W3b.5). The take path records epoch_now - header.stamp per message (fetch_max); the age check drains it (swap 0) per window.
Fields§
§max_age_ms: AtomicU32Max observed take-age (ms) in the current check window.
takes: AtomicU32Observations recorded since the last check, drained
(swap 0) by check_age. The age itself cannot answer “did anything
arrive”: a window with no take and a window whose only take was
perfectly fresh both leave max_age_ms at 0.
deadline_slot: AtomicU32The executor slot + 1 whose readiness is this
endpoint’s arrival evidence, set when the contract’s deadline is
judged here rather than by the backend (admit_contract_deadline).
0 = not armed: the backend judges the deadline, or none is declared.
arrivals: AtomicU32Spins on which the armed slot had data, drained by
check_age. Counted for ANY message type, stamped or not, because a
deadline is a promise about arrival and says nothing about stamps.
Implementations§
Source§impl SubMonitorCell
impl SubMonitorCell
pub const fn new() -> Self
Sourcepub fn observe(&self, stamp_us: u64, epoch_now_us: u64)
pub fn observe(&self, stamp_us: u64, epoch_now_us: u64)
Take-path hook: record one message’s age. stamp_us is the
peeked header.stamp as µs since the UNIX epoch, epoch_now_us
the receive-side wall clock. A stamp from the future clamps to 0.
Also the silence rule’s only evidence that this
endpoint is being fed. It counts what the AGE rule can see, which is
stamped takes on a type that carries a stamp: a contracted endpoint
whose messages carry no readable stamp records nothing here and is
reported silent. That is the intended verdict rather than a gap –
its max_age_ms cannot be judged either, and an unjudgeable promise
reported as met is the silent class this phase exists to remove.
Sourcepub fn observe_unaged(&self)
pub fn observe_unaged(&self)
A stamped take on an image with NO epoch source: the
stamp was read (the type carries one and it is a real time), so the
take is the silence rule’s evidence exactly as Self::observe’s is,
but its age cannot be computed against a clock that is not on the
stamp’s epoch, so max_age_ms is left alone and max-age-runtime
judges nothing on such an image. An unstamped take is still not
evidence: nothing here counts arrivals.