phpbotgram

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_delay and min_delay = 0.0. Upstream rejects max_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 accept min_delay = 0.0 for 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

$factor  : float
$jitter  : float
$maxDelay  : float
$minDelay  : float

Methods

__construct()  : mixed

Properties

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
On this page

Search results