1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright (c) 2026 Mike Grier
//! The retry protocol (D-27): fixed per-operation defaults, a floor, and the
//! earliest-answer reduction over a fault's asked subscriptions.
//!
//! `WatchOptions` carries only [`crate::watch::RetryMode`]'s two variants --
//! `Defaults` or `Interactive` -- with no numeric override. So unlike the
//! aspirational "soonest-recovering reduction" language in the crate's fault
//! model notes (growth multiplier, cap, jitter, per-error-kind override), there
//! is no field anywhere a caller could use to state one of those, and this
//! module does not invent behaviour nobody can configure. What is implemented is
//! exactly D-27's literal text: a fixed delay per failing operation, asked of
//! every interactive subscription, resolved to the earliest answer (a decliner
//! counted at the default), and clamped to a floor.
use Duration;
/// The delay used when nothing overrides it, and nobody was asked. Also every
/// interactive decliner's answer.
///
/// One value for both operations, per `Azure/m`'s shipped code (D-27); kept as
/// two constants because D-15 nonetheless keeps the operations texturally
/// distinct and a future divergence should not have to touch every call site.
pub const OPEN_DEFAULT_DELAY: Duration = from_millis;
pub const ARM_DEFAULT_DELAY: Duration = from_millis;
/// No answer, from anyone, is ever honoured below this. Protects against a hot
/// retry loop driven by a misbehaving or miscoded interactive answer.
pub const FLOOR: Duration = from_millis;
/// Which failing operation a fault arose from, matching D-15's reopen-retry /
/// rearm-retry split. Each has its own default delay.
/// The mode a watch is established in (D-13/D-17).
/// Clamp a resolved delay to the floor.
pub