Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AsyncRetryArgs<T>

Args object for asyncRetry

Type parameters

  • T

Hierarchy

  • AsyncRetryArgs

Index

Properties

asyncFn

asyncFn: function

The promise to be executed. It needs to throw an error in case of failure

Type declaration

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

Optional maxRetrials

maxRetrials: number

The absolute maximum number of retrials. Default: 20

onFailureAsync

onFailureAsync: function

The callback in case of a failure of asyncFn. Can be used to prepare something before as asyncFn is being called next

param

The error thrown by asyncFn

param

The number of retrials (incremented automatically) so far

returns

true if asyncFn should be called again, or false

Type declaration

    • (e: Error, retryCount: number): Promise<boolean>
    • Parameters

      • e: Error
      • retryCount: number

      Returns Promise<boolean>

Optional retryCount

retryCount: number

The counter of retrials. It is managed automatically, so you do not need to set this