carbond.limiter.WindowLimiterPolicy¶
WindowLimiterPolicy is a concrete implementation of
LimiterPolicy that limits the number of requests
allowed within a sliding window of time.
Class¶
-
class
carbond.limiter.WindowLimiterPolicy()¶ extends:
Limiter- ¶
window IntegerDefault 1000 Description The sliding window in milliseconds.
- ¶
reqLimit IntegerDefault 1 Description The number of requests allowed within window.
- ¶
allow Arguments - req (
express.request) – the currentRequestobject - res (
express.response) – the currentResponseobject - selector (
String) – A string used to group similar requests
Returns trueif the policy allows the request, elsefalseReturn type BooleanDescription Overrides allowto implement windowing logic.- req (