Skip to main content
Version: 3.25.0

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 with new. Attempting to call it without new throws a TypeError.

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