MeilisearchRetryPolicy
class MeilisearchRetryPolicy
Retry policy for the Meilisearch HTTP client.
The meilisearch/meilisearch-php client has no built-in retry mechanism (unlike Algolia's PHP client which has host failover, and Typesense's which has num_retries). Hypervel adds HTTP-level retry at the Guzzle handler-stack layer for parity, using this policy to decide which responses or exceptions warrant a retry and how long to wait.
Constants
| private RETRYABLE_STATUS_CODES |
Status codes that indicate transient failures and should be retried. |
Methods
Determine whether a response or exception should trigger a retry.
Calculate the delay in milliseconds before the given retry attempt.
Build a Guzzle retry middleware configured with this policy.
Details
at line 32
static bool
shouldRetry(ResponseInterface|null $response, Throwable|null $exception)
Determine whether a response or exception should trigger a retry.
at line 51
static int
nextDelayMs(int $attempt, int $baseDelayMs)
Calculate the delay in milliseconds before the given retry attempt.
Attempts are 1-based: the first retry waits $baseDelayMs, the second waits twice that, and so on (exponential backoff).
at line 59
static callable
middleware(int $maxRetries, int $baseDelayMs)
Build a Guzzle retry middleware configured with this policy.