API Core - v1.5.0
    Preparing search index...

    Class CompositePolicy

    Compose N policies into a single pipeline. The first policy in the array is the outermost wrapper — it sees the request before any inner policy gets to decorate it, and sees the result last.

    Example: new CompositePolicy([rate, auth, transient]).run(fetch) runs as rate(auth(transient(fetch))). A transient 5xx is retried first; a 401 on the last attempt triggers auth-retry; a 429 in any branch hits the rate-limit gate outermost.

    An empty composite is a no-op pass-through.

    Implements

    Index
    • Runs the attempt through the composed pipeline.

      Type Parameters

      • T

      Parameters

      • attempt: () => Promise<T>

        The request attempt to decorate.

      Returns Promise<T>

      The attempt's resolved value.