Expand description
The ONE wait/retry engine (02-04) — shared by the log tail here and
by 02-05’s wait / restart --wait. Deliberately ~40 lines + tests
instead of a retry framework (STACK.md rejected reqwest-middleware;
02-RESEARCH §Wait-loop pattern).
Semantics (research-locked):
- adaptive interval: ×1.5 growth clamped to
[interval, 30 s](igw-cli’s verified pattern); NetworkandGatewayRestartingare RETRIED (transient: the webserver answers 503 mid-restart and connections flap);Authis NEVER retried — retrying a rejected token cannot succeed; fail fast (exit 5);- any other error aborts;
- deadline expiry →
CoreError::Network-class timeout (exit 4,network_errorslug — NO new variant; the source isNoneandurlcarries the poll’s subject). The last observation rides the dedicatedobservationfield (09-07):Some⇒ the gateway ANSWERED (Display leads “no terminal state”, never claims unreachability for an observed answer);None⇒ today’s plain “gateway unreachable” wording preserved.
deadline = Duration::MAX runs until the process is killed — the
documented Ctrl-C contract for logs -f (default kill, no envelope).
Structs§
- Poll
Config - Poll tuning.
Default: 2 s interval, 30 s clamp, 120 s deadline.
Enums§
- Poll
State - What one probe reports.
Functions§
- poll
- Poll
probeuntilDone, the deadline expires, or an unretryable error fires (see module docs for the retry matrix). The FIRST probe runs immediately — no initial sleep.
Type Aliases§
- Probe
- One probe call: a boxed future borrowing the probe closure, so the closure can carry mutable state (the tail’s cursor and sink) across iterations without naming an unnameable future type.