Function retryIterator

  • Returns an iterable iterator that yields delay values for each retry attempt, based on the specified retry policy. The iterator stops yielding delay values when either the timeout is reached or the maximum number of attempts is exceeded.

    Type Parameters

    • T extends {
          attempt: number;
          retryPolicy: RetryPolicy;
          timeout: number;
      }

    Parameters

    • ctx: T

      The context object containing the retry policy, attempt number, and timeout.

    Returns IterableIterator<number>

    An iterable iterator that yields delay values for each retry attempt.