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