pub struct PublisherRetryScope { /* private fields */ }Expand description
RAII scope for ONE crate::Publisher invocation: it installs the backoff
attribution label (a RetryScope) and anchors the wall-clock retry budget
that crate::context::Context::retry_deadline reports for the whole invocation.
Install exactly one at every seam that calls into a publisher —
run, reconcile, rollback, preflight. The budget belongs to the
invocation, not to the call that happens to ask for it: a publisher that
resolves the deadline at three seams (an auth exchange, the publish request,
a cleanup) gets one budget covering all three, so a wedged registry cannot
spend retry.max_elapsed once per seam.
Entering while a budget is already open INHERITS it rather than replacing
it, so nothing reachable from inside a publisher — including a nested guard
of this same type — can widen the invocation’s budget. A later, genuinely
distinct invocation (the rollback pass after run returned) enters its own
guard once the previous one has dropped, and correctly gets a fresh budget.