Skip to main content

Class: BatchThrottler

Represents a throttler that allows x requests per second before sleeping until the next second.

const throttler = new BatchThrottler(15);
// 15 requests every second.

Constructors

constructor

new BatchThrottler(rateLimit?, sleepTime?)

Parameters

NameTypeDefault value
rateLimitnumber15
sleepTimenumber1000

Defined in

rest/Throttler.ts:48

Methods

wait

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

Returns

Promise<IteratorResult<undefined, void>>

Defined in

rest/Throttler.ts:65