Skip to main content

RateLimiter Class

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/driver-utils/legacy.

For more information about our API support guarantees, see here.

Signature

export declare class RateLimiter

Constructors

Constructor Alerts Description
(constructor)(maxRequests) Beta Constructs a new instance of the RateLimiter class

Properties

Property Alerts Modifiers Type Description
release Beta readonly () => void
waitQueueLength Beta readonly number

Methods

Method Alerts Return Type Description
acquire() Beta Promise<void>
schedule(work) Beta Promise<T>

Constructor Details

(constructor)

Constructs a new instance of the RateLimiter class

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
constructor(maxRequests: number);

Parameters

Parameter Type Description
maxRequests number

Property Details

release

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
protected readonly release: () => void;

Type: () => void

waitQueueLength

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
get waitQueueLength(): number;

Type: number

Method Details

acquire

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
protected acquire(): Promise<void>;

Returns

Return type: Promise<void>

schedule

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature
schedule<T>(work: () => Promise<T>): Promise<T>;
Type Parameters
Parameter Description
T

Parameters

Parameter Type Description
work () => Promise<T>

Returns

Return type: Promise<T>