Framework
Version
Debouncer API Reference
Throttler API Reference
Rate Limiter API Reference
Queue API Reference
Batcher API Reference

AsyncRateLimiterState

Interface: AsyncRateLimiterState<TFn>

Defined in: async-rate-limiter.ts:5

Type Parameters

TFn extends AnyAsyncFunction

Properties

errorCount

ts
errorCount: number;
errorCount: number;

Defined in: async-rate-limiter.ts:9

Number of function executions that have resulted in errors


executionTimes

ts
executionTimes: number[];
executionTimes: number[];

Defined in: async-rate-limiter.ts:13

Array of timestamps when executions occurred for rate limiting calculations


isExecuting

ts
isExecuting: boolean;
isExecuting: boolean;

Defined in: async-rate-limiter.ts:17

Whether the rate-limited function is currently executing asynchronously


lastResult

ts
lastResult: undefined | ReturnType<TFn>;
lastResult: undefined | ReturnType<TFn>;

Defined in: async-rate-limiter.ts:21

The result from the most recent successful function execution


rejectionCount

ts
rejectionCount: number;
rejectionCount: number;

Defined in: async-rate-limiter.ts:25

Number of function executions that have been rejected due to rate limiting


settleCount

ts
settleCount: number;
settleCount: number;

Defined in: async-rate-limiter.ts:29

Number of function executions that have completed (either successfully or with errors)


successCount

ts
successCount: number;
successCount: number;

Defined in: async-rate-limiter.ts:33

Number of function executions that have completed successfully

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.