Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RetrySettings

Settings of retry function.

Hierarchy

  • RetrySettings

Indexable

[field: string]: unknown

Settings of retry function.

Index

Properties

action

action: RetryAction

A function that should be called.

Optional actionContext

actionContext: unknown

An object that should be used as this when calling the action function.

Optional actionParams

actionParams: unknown[]

An array of parameters that should be passed into the action function.

Optional delay

delay: number

An amount of milliseconds before first call of the action function. When the value is not specified or is negative, the action function will be called immediately first time.

Optional retryAttempts

retryAttempts: RetryTimeout[]

An array specifying amount and timeouts between repeated calls of the action function. Each item can be a number or a function (see retryTimeout setting for details). Has priority over retryQty and retryTimeout settings.

Optional retryOnError

retryOnError: boolean | RetryTest

A boolean value or a function returning boolean value that specifies whether the action function should be called again when the action function throws an error or returned promise is rejected. When not specified the call of the action function will not be repeated on an error.

Optional retryQty

retryQty: number

Maximum number of repeated calls of the action function. A negative value means no restriction. Default value is -1.

Optional retryTest

retryTest: boolean | RetryTest

A boolean value or a function returning boolean value that specifies whether the action function should be called again after a made call. When not specified the action call will not be repeated.

Optional retryTimeout

retryTimeout: RetryTimeout

A timeout between repeated calls of the action function, or a function that returns such timeout. A negative or non-number value means the repeat call will be made without delay (this is applied by default). If specified function returns false then retry process will be finished and result promise will be fulfilled or rejected depending on result of the last action's call.

Optional timeLimit

timeLimit: number

Time in milliseconds specifying how long retry process can last starting from call of retry function. Elapsed time is checked before each retry attempt and when the time exceeds the given limit process will be finished and result promise will be fulfilled or rejected depending on result of the last action's call. 0 or negative value means no limit.

Generated using TypeDoc