Skip to main content
Version: v1

IProgress Interface

Interface describing an object passed to various network APIs. It allows caller to control cancellation, as well as learn about any delays.

Signature​

export interface IProgress

Properties​

PropertyModifiersTypeDescription
canceloptionalAbortSignalAbort signal used to cancel operation Note that most of the layers do not use this signal yet. We need to change that over time. Please consult with API documentation / implementation. Note that number of layers may not check this signal while holding this request in a queue, so it may take a while it takes effect. This can be improved in the future. Layers in question are: - driver (RateLimiter) - runWithRetry

Methods​

MethodModifiersReturn TypeDescription
onRetry(delayInMs, error)optionalvoidCalled whenever api returns cancellable error and the call is going to be retried. Any exception thrown from this call back result in cancellation of operation and propagation of thrown exception.

Property Details​

cancel​

Abort signal used to cancel operation Note that most of the layers do not use this signal yet. We need to change that over time. Please consult with API documentation / implementation. Note that number of layers may not check this signal while holding this request in a queue, so it may take a while it takes effect. This can be improved in the future. Layers in question are: - driver (RateLimiter) - runWithRetry

Signature​

cancel?: AbortSignal;

Type: AbortSignal

Method Details​

onRetry​

Called whenever api returns cancellable error and the call is going to be retried. Any exception thrown from this call back result in cancellation of operation and propagation of thrown exception.

Signature​

onRetry?(delayInMs: number, error: any): void;

Parameters​

ParameterTypeDescription
delayInMsnumberdelay before next retry. This value will depend on internal back-off logic, as well as information provided by service (like 429 error asking to wait for some time before retry)
erroranyerror object returned from the call.