Cell API
    Preparing search index...

    Interface RetryOperations

    RetryOperations interface represents the operations for retrying a task with different options.

    interface RetryOperations {
        execute<T>(
            callback: RetryCallback<T>,
            options?: RetryOptions<T>,
        ): Promise<T>;
    }

    Implemented by

    Index
    • Execute the callback function with the given options.

      Type Parameters

      • T

        The type of the return value of the callback function.

      Parameters

      Returns Promise<T>

      • The result of the callback function
      • If an error occurred during retry.
      const result = await retryOperations.execute(async () => {
      // do something
      }, { maxAttempts: 3, timeout: 1000 });
      console.log(result);
      const result = await retryOperations.execute(async () => {
      // do something
      }, { maxAttempts: 3, timeout: 1000, backOffOptions: { delay: 1000 } });
      console.log(result);
      const result = await retryOperations.execute(async () => {
      // do something
      }, { maxAttempts: 3, timeout: 1000, backOffOptions: { delay: 1000, multiplier: 2 } });
      console.log(result);
      const result = await retryOperations.execute(async () => {
      // do something
      }, { maxAttempts: 3, timeout: 1000, backOffOptions: { delay: 1000, multiplier: 2, random: true } });
      console.log(result);
      const result = await retryOperations.execute(async () => {
      // do something
      }, { maxAttempts: 3, timeout: 1000, backOffOptions: { delay: 1000, multiplier: 2, random: true, maxDelay: 5000 } });
      console.log(result);