SlidingWindowLimiter class final
Sliding window limiter backed by fixed-size time segments.
- Implemented types
Constructors
- SlidingWindowLimiter({required int permitLimit, required Duration window, required int segmentsPerWindow})
- Creates a sliding window limiter.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- permitLimit → int
-
Maximum permits available in the rolling window.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- segmentsPerWindow → int
-
Number of segments in window.
final
- window → Duration
-
Rolling window duration.
final
Methods
-
acquire(
RateLimitContext context) → RateLimitLease -
Attempts to acquire a lease for
context.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited