FixedWindowRateLimiterStrategy
Defined in: src/window-rate-limiter.ts:644
permitLimit per window; the count resets at each window boundary (a burst of 2x can straddle a boundary).
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”T
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FixedWindowRateLimiterStrategy<
T>(options,source):FixedWindowRateLimiterStrategy<T>
Defined in: src/window-rate-limiter.ts:645
Parameters
Section titled “Parameters”options
Section titled “options”source
Section titled “source”Returns
Section titled “Returns”FixedWindowRateLimiterStrategy<T>
Overrides
Section titled “Overrides”RateLimiterStrategy.constructor
Accessors
Section titled “Accessors”queued
Section titled “queued”Get Signature
Section titled “Get Signature”get queued():
number
Defined in: src/window-rate-limiter.ts:426
Executions waiting for permits.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”block()
Section titled “block()”block(
duration):void
Defined in: src/window-rate-limiter.ts:522
Parameters
Section titled “Parameters”duration
Section titled “duration”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”delete()
Section titled “delete()”delete():
Promise<void>
Defined in: src/window-rate-limiter.ts:532
Fresh quota and no block.
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”execute()
Section titled “execute()”execute(
next,context):Promise<Outcome<T,unknown>>
Defined in: src/window-rate-limiter.ts:430
Parameters
Section titled “Parameters”Next<T>
context
Section titled “context”Returns
Section titled “Returns”Promise<Outcome<T, unknown>>
Inherited from
Section titled “Inherited from”penalty()
Section titled “penalty()”penalty(
points):Promise<void>
Defined in: src/window-rate-limiter.ts:513
Parameters
Section titled “Parameters”points
Section titled “points”number
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”restore()
Section titled “restore()”restore(
snapshot):void
Defined in: src/window-rate-limiter.ts:504
Loads a snapshot(); time passed since it was taken counts (windows expire, tokens refill, blocks run out).
Parameters
Section titled “Parameters”snapshot
Section titled “snapshot”Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”reward()
Section titled “reward()”reward(
points):Promise<void>
Defined in: src/window-rate-limiter.ts:517
Parameters
Section titled “Parameters”points
Section titled “points”number
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”snapshot()
Section titled “snapshot()”snapshot():
RateLimiterSnapshot
Defined in: src/window-rate-limiter.ts:496
The algorithm’s state and the block, JSON-serializable, for restore after a restart.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”unblock()
Section titled “unblock()”unblock():
void
Defined in: src/window-rate-limiter.ts:526
Returns
Section titled “Returns”void