Skip to main content

IBackOffOptions

@appfire/fuse-http-clientDocs


@appfire/fuse-http-client / IBackOffOptions

Type Alias: IBackOffOptions

IBackOffOptions: object

Type declaration

delayFirstAttempt

delayFirstAttempt: boolean

Decides whether the startingDelay should be applied before the first call. If false, the first call will occur without a delay.

Default

false

jitter

jitter: JitterType

Decides whether a jitter should be applied to the delay. Possible values are full and none.

Default

none

logRetry

logRetry: boolean

logs error and current attempt when retryFn is not passes

Default

true

maxDelay

maxDelay: number

The maximum delay, in milliseconds, between two consecutive attempts.

Default

Infinity

numOfAttempts

numOfAttempts: number

The maximum number of times to attempt the function.

Default

10

Min

1

retryFn?

optional retryFn: RetryFunction

Param

Error

Param

current attempt Number

Returns

boolean

Default

By default, returns true and retries until retries exhausts or retry is successful. It also logs error using console.error and prints current attempt number. returns false will end execution

startingDelay

startingDelay: number

The delay, in milliseconds, before executing the function for the first time.

Default

100ms

timeMultiple

timeMultiple: number

The startingDelay is multiplied by the timeMultiple to increase the delay between reattempts.

Default

2

Defined in

types/config.types.ts:9