Adaptive pacing and retries middleware.
Paces the exchanges routed through the wrapped Fetch implementation with an adaptive throttle, retrying transient failures as the target directs.
Usage
import { createFetch } from "@metreeca/http";import { success } from "@metreeca/http/success";import { throttle } from "@metreeca/http/throttle";import { timeout } from "@metreeca/http/timeout";const client = createFetch( success(), // declared before throttle: retries see responses, not rejections throttle({ minimum: 100, attempts: 3 }), timeout(5000) // bounds each attempt on its own); Copy
import { createFetch } from "@metreeca/http";import { success } from "@metreeca/http/success";import { throttle } from "@metreeca/http/throttle";import { timeout } from "@metreeca/http/timeout";const client = createFetch( success(), // declared before throttle: retries see responses, not rejections throttle({ minimum: 100, attempts: 3 }), timeout(5000) // bounds each attempt on its own);
RFC 9110 § 10.2.3 - Retry-After
Creates a middleware pacing exchanges and retrying transient failures.
Adaptive pacing and retries middleware.
Paces the exchanges routed through the wrapped Fetch implementation with an adaptive throttle, retrying transient failures as the target directs.
Usage
See
RFC 9110 § 10.2.3 - Retry-After