• Run fn, retrying on transient errors with exponential backoff + jitter.

    The initial call counts as attempt 0; up to maxRetries further attempts are made. Permanent errors (per isRetryableRpcError) are re-thrown immediately. The last error is re-thrown once retries are exhausted.

    Pass options.signal to cancel the loop; the pending backoff is cut short and the returned promise rejects with the signal's reason.

    Type Parameters

    • T

    Parameters

    • fn: (() => Promise<T>)
        • (): Promise<T>
        • Returns Promise<T>

    • options: RetryOptions = {}

    Returns Promise<T>