EdgeRateLimiter()
The EdgeRateLimiter
constructor lets you open an epen a ERL with the given ratecounter and penaltybox.
Note: Can only be used when processing requests, not during build-time initialization.
Syntax
new EdgeRateLimiter(rateCounter, penaltyBox)
Note:
EdgeRateLimiter()
can only be constructed withnew
. Attempting to call it withoutnew
throws aTypeError
.
Parameters
rateCounter
: RateCounter- The RateCounter instance to associate with this EdgeRateLimiter instance
penaltyBox
: PenaltyBox- The PenaltyBox instance which should be associated with this EdgeRateLimiter instance
Return value
A new EdgeRateLimiter
object.
Exceptions
TypeError
- Thrown if the provided rateCounter value is not an instance of RateCounter
- Thrown if the provided penaltyBox value is not an instance of PenaltyBox