pub struct LoopProgressMark { /* private fields */ }Expand description
Where one integrator’s loop had got to the last time it asked.
Three numbers and nothing else: the furthest record this binding has been offered something from, how many of its deliveries had been closed, and how many asks it has spent since either of those last moved. A round is one ask, which is the only thing that makes “going round without getting anywhere” measurable — the ledger can say what is outstanding but not how many times a host has come back to look at it, and a lease is about exclusion rather than rounds.
The head is this binding’s own, not the engine’s. A cursor walks the global feed and advances over every ceremony in the deployment, so a busy neighbour would move it every second and hide a stall for ever.
Kept on the binding because it is the binding’s, and durable because a process that restarted mid-loop would otherwise come back with a fresh count and go round for ever.
Implementations§
Source§impl LoopProgressMark
impl LoopProgressMark
pub const fn new( head: Option<GlobalPosition>, closed: u32, rounds: u32, stuck: u32, ) -> Self
Sourcepub fn observing(
self,
head: Option<GlobalPosition>,
closed: u32,
owed: Owed,
) -> Self
pub fn observing( self, head: Option<GlobalPosition>, closed: u32, owed: Owed, ) -> Self
The mark after one more ask, given what that ask could see.
A round counts against the loop only when the binding was holding work and neither the news nor the work moved. The two halves matter separately. Without the first, a loop that polls while an agent works a long step is declared stuck on its third second. Without the second, a host that takes something and does nothing with it is never noticed.
Both readings are of durable facts — what this binding has been offered, and what it has closed — so the same ask reaches the same conclusion before and after a restart.
Sourcepub fn differs_from(self, previous: Self) -> bool
pub fn differs_from(self, previous: Self) -> bool
Whether this mark says anything the last one did not.
The ask count always moves, and on its own it changes no decision unless the policy set a ceiling. Everything else is what the stall is read from.
Sourcepub const fn head(self) -> Option<GlobalPosition>
pub const fn head(self) -> Option<GlobalPosition>
How far the feed had been projected when this binding last asked.