Skip to main content

Class: QueueThrottler

Represents a throttler that sleeps for x ms between each request.

const throttler = new QueueThrottler(1000 / 10);
// 10 requests per second or sleep for 100ms between each request.

Constructors

constructor

new QueueThrottler(sleepTime?)

Parameters

NameTypeDefault value
sleepTimenumber100

Defined in

rest/Throttler.ts:14

Methods

wait

wait(): Promise<IteratorResult<undefined, void>>

Returns

Promise<IteratorResult<undefined, void>>

Defined in

rest/Throttler.ts:31