BackoffConfig
in package
Read onlyYes
FinalYes
Tuning knobs for the long-poll retry `Backoff` — port of `aiogram.utils.backoff.BackoffConfig`.
Defaults mirror upstream DEFAULT_BACKOFF_CONFIG exactly
(aiogram/dispatcher/dispatcher.py:35):
min=1.0s, max=5.0s, factor=1.3, jitter=0.1.
Spec deviation from aiogram proper:
- Allows
min_delay == max_delayandmin_delay = 0.0. Upstream rejectsmax_delay <= min_delay; we relax that to<so callers can pin a constant retry delay (useful in tests and in deterministic immediate-retry strategies). We also acceptmin_delay = 0.0for the same reason — upstream silently allows it but never documents the intent, so we add an explicit non-negativity check for clarity.
The class is readonly: once a Backoff is wired to a config, swapping
thresholds mid-flight would race with the loop's next_delay computation.
Callers wanting a new schedule must build a new config + Backoff.
Table of Contents
Properties
Methods
- __construct() : mixed
Properties
$factor
public
float
$factor
= 1.3
$jitter
public
float
$jitter
= 0.1
$maxDelay
public
float
$maxDelay
= 5.0
$minDelay
public
float
$minDelay
= 1.0
Methods
__construct()
public
__construct([float $minDelay = 1.0 ][, float $maxDelay = 5.0 ][, float $factor = 1.3 ][, float $jitter = 0.1 ]) : mixed
Parameters
- $minDelay : float = 1.0
- $maxDelay : float = 5.0
- $factor : float = 1.3
- $jitter : float = 0.1