yggdrasil.dataclasses.waiting¶
waiting ¶
WaitingConfig
dataclass
¶
WaitingConfig(
timeout: float = DEFAULT_TIMEOUT_TICKS,
interval: float = 0.5,
backoff: float = 1.5,
max_interval: float = 10.0,
retries: int = 4,
max_attempts: Optional[int] = 4,
)
sleep ¶
iteration is 0-based (first wait => iteration=0)
Backoff sleep strategy: - interval == 0 => no sleep - backoff >= 1 => interval * backoff**iteration - max_interval == 0 => no cap, else cap sleep to max_interval - if start is provided and timeout > 0: * raise TimeoutError if already out of time * cap sleep so we don't oversleep past timeout