RetryPolicy
in package
FinalYes
Retries a request only on network failure or an HTTP 5xx/429 response, using exponential backoff with jitter, and honors a `Retry-After` response header ahead of the computed backoff delay when present. Any other 4xx is never retried — it won't succeed on a second attempt, and retrying only delays the real error reaching the caller.
Table of Contents
Methods
- decider() : callable
- delay() : callable
- delayMs() : int
- retryAfterMs() : int|null
Methods
decider()
public
static decider(int $maxRetries) : callable
Parameters
- $maxRetries : int
Return values
callabledelay()
public
static delay() : callable
Return values
callabledelayMs()
public
static delayMs(int $retries[, ResponseInterface|null $response = null ]) : int
Parameters
- $retries : int
- $response : ResponseInterface|null = null
Return values
intretryAfterMs()
private
static retryAfterMs(ResponseInterface $response) : int|null
Parameters
- $response : ResponseInterface