MemoryRateLimitStore class

In-memory, process-local fixed-window store (zero dependencies).

Suitable for single-instance deployments. Expired entries are swept lazily once the map grows past sweepThreshold to bound memory.

Implemented types

Constructors

MemoryRateLimitStore({int sweepThreshold = 10000})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sweepThreshold int
final

Methods

hit(String key, Duration window) RateLimitHit
Records a request for key within window and returns the new state.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset(String key) → void
Clears the counter for key.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited