File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## [ Unreleased]
4+
5+ ### Added
6+
7+ - ` Innmind\HttpTransport\Transport::exponentialBackoff() ` now accepts a third parameter to specify the retry periods
8+
39## 9.0.0 - 2026-02-01
410
511### Added
Original file line number Diff line number Diff line change @@ -42,14 +42,19 @@ public function __invoke(Request $request): Either
4242
4343 /**
4444 * @psalm-pure
45+ *
46+ * @param ?Sequence<Period> $retries
4547 */
46- public static function of (Implementation $ fulfill , Halt $ halt ): self
47- {
48+ public static function of (
49+ Implementation $ fulfill ,
50+ Halt $ halt ,
51+ ?Sequence $ retries = null ,
52+ ): self {
4853 /** @psalm-suppress ArgumentTypeCoercion Periods are necessarily positive */
4954 return new self (
5055 $ fulfill ,
5156 $ halt ,
52- Sequence::of (
57+ $ retries ?? Sequence::of (
5358 Period::millisecond ((int ) (\exp (0 ) * 100.0 )),
5459 Period::millisecond ((int ) (\exp (1 ) * 100.0 )),
5560 Period::millisecond ((int ) (\exp (2 ) * 100.0 )),
Original file line number Diff line number Diff line change 1010 Period ,
1111 Halt ,
1212};
13- use Innmind \Immutable \Either ;
13+ use Innmind \Immutable \{
14+ Either ,
15+ Sequence ,
16+ };
1417use Psr \Log \LoggerInterface ;
1518
1619/**
@@ -51,13 +54,18 @@ public static function circuitBreaker(
5154 ));
5255 }
5356
57+ /**
58+ * @param ?Sequence<Period> $retries
59+ */
5460 public static function exponentialBackoff (
5561 self $ transport ,
5662 Halt $ halt ,
63+ ?Sequence $ retries = null ,
5764 ): self {
5865 return new self (ExponentialBackoff::of (
5966 $ transport ->implementation ,
6067 $ halt ,
68+ $ retries ,
6169 ));
6270 }
6371
You can’t perform that action at this time.
0 commit comments