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
Name | Type | Default value |
---|---|---|
rateLimit | number | 15 |
sleepTime | number | 1000 |
Defined in
Methods
wait
▸ wait(): Promise
<IteratorResult
<undefined
, void
>>
Returns
Promise
<IteratorResult
<undefined
, void
>>