RateLimiterGroup

RateLimiterGroup

A grouping for RateLimiter classes.

Constructor

new RateLimiterGroup()

Source:

Extends

  • {@link

Classes

RateLimiterGroup

Methods

(async) add(label, spec)

Source:
Add a {RateLimiter} singleton to this group.
Parameters:
Name Type Description
label String The unique label identifying the RateLimiter.
spec RateLimiterSpec The spec to be used for the RateLimiter.

(async) increment()

Source:
Increment usage by 1 for all the rate limiters in this group.

(async) initialized()

Source:
Wait for all limiters to finish init.

resumes() → {Number}

Source:
Returns:
When the group will resume from all suspensions.
Type
Number

suspended() → {boolean}

Source:
Returns:
True if any of the limiters are suspended.
Type
boolean

(async) wait()

Source:
Wait for all the limiters in this group to unblock.

willSuspendFor() → {Number}

Source:
Return the max suspend time for all the rate limiters in this group.
Returns:
Milliseconds of pending suspend or 0.
Type
Number