RetryOptions | baconjs (original) (raw)
Type parameters
V
Hierarchy
- RetryOptions
Index
Properties
Optional retries
retries: undefined | number
Required. The number of times to retry the source
function in addition to the initial attempt. The default value is 0 (zero) for retrying indefinitely.
source
source: (attemptNumber: number) => Observable<V>
Required. A function that produces an Observable. The function gets attempt number (starting from zero) as its argument.
Type declaration
- (attemptNumber: number): Observable<V>
Parameters
* ##### attemptNumber: number
Returns Observable<V>
Methods
Optional delay
- delay(context: RetryContext): number
- Optional. A function that returns the time in milliseconds to wait before retrying. Defaults to
0
. The function is given a context object with the keyserror
(the error that occurred) andretriesDone
(the number of retries already performed) to help determine the appropriate delay e.g. for an incremental backoff.
Parameters
RetryContext
context:
Returns number
Optional isRetryable
- isRetryable(error: any): boolean
- Optional. A function returning
true
to continue retrying,false
to stop. Defaults totrue
. The error that occurred is given as a parameter. For example, there is usually no reason to retry a 404 HTTP error, whereas a 500 or a timeout might work on the next attempt.
Parameters
error: any