Skip to main content
Version: v2

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​

ConstructorAlertsDescription
(constructor)(maxRequests)BetaConstructs a new instance of the RateLimiter class

Properties​

PropertyAlertsModifiersTypeDescription
releaseBetareadonly() => void
waitQueueLengthBetareadonlynumber

Methods​

MethodAlertsReturn TypeDescription
acquire()BetaPromise<void>
schedule(work)BetaPromise<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​

ParameterTypeDescription
maxRequestsnumber

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​
ParameterDescription
T

Parameters​

ParameterTypeDescription
work() => Promise<T>

Returns​

Return type: Promise<T>