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

Property Modifiers Type Description
cancel optional AbortSignal 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

Methods

Method Modifiers Return Type Description
onRetry(delayInMs, error) optional void 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.

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

Parameter Type Description
delayInMs number delay 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)
error any error object returned from the call.