Class implementing a time-based rate limiter. Allows requests based on specified timeframes and their respective limits.
Creates an instance of the TimeBasedLimiter class with specified timeframes and limits.
The configuration mapping timeframes to their respective limits.
Private
Makes a request within the rate limiter. Checks if the request is allowed based on the timeframes and their limits.
True if the request is allowed, otherwise false.
Initializes the request queues for a specific key. Each key will have multiple queues, each corresponding to a specific timeframe and its limit.
An array of deques representing the request queues for the key.
Generated using TypeDoc
Class implementing a time-based rate limiter. Allows requests based on specified timeframes and their respective limits.