Optional
limitDefines behavior when the rate limit is reached.
The possible values are:
enqueue
- Enqueues the request and send it when possible.throw
- Throws the RateLimitReachedError
exception when rate limit is reached.null
- Returns null
when rate limit is reached.enqueue
Optional
limitLimits the number of requests per second to one.
According to the official documentation, Donation Alerts API limits requests to the API methods for each application by 60 requests per minute, making it 1 request per second.
The library, by default, limits the number of requests to 1 per second. This means that if you run, for example, 60 concurrent requests at the same time, they will be executed sequentially at 1 request per second.
If you set this option to false
, you can reach the rate limit let's say in 10 seconds, and the library will not
be able to send requests for the remaining 50 seconds of the available 60 seconds timeframe.
By default, all requests enqueued to execute later when possible. You can change this behavior by setting limitReachedBehavior property.
true
Generated using TypeDoc
Defines the rate limiter options.