Retry a callable with exponential backoff in PHP
Re-run flaky operations with growing delays and jitter, only for chosen exception types.
Loading snippets…
8 snippets
Re-run flaky operations with growing delays and jitter, only for chosen exception types.
A fetch wrapper that throws on HTTP errors and validates the JSON body with a type guard.
Validate an HMAC-SHA256 webhook against the raw request body with a constant-time comparison and replay window.
Parse JSON with exceptions on error and a depth limit, instead of silently getting null.
Retry a failing promise-returning function with growing, jittered delays and a retry predicate.
Re-run a flaky function a limited number of times with growing delays, only for chosen exception types.
Iterate cursor-paginated API results with for await, loading pages lazily and stopping early when needed.
Abort slow HTTP requests with AbortSignal.timeout and turn non-2xx responses into real errors.