RateLimitService class
Evaluates compiled policies for incoming requests.
Matching policies are evaluated in list order. Every matching policy with a resolvable identity consumes its own allowance until one blocks the request; therefore a request can consume multiple policy quotas.
Constructors
-
RateLimitService(List<
CompiledRateLimitPolicy> _policies, {RateLimitEventCallbacks? callbacks}) - Creates a service for the supplied policies.
Properties
Methods
-
attachCallbacks(
RateLimitEventCallbacks? callbacks) → void - Replaces the callbacks used for subsequent evaluations.
-
check(
RateLimitRequest request) → Future< RateLimitOutcome?> -
Evaluates
requestand returns the first blocking outcome. -
dispose(
) → Future< void> - Closes each distinct backend used by this service.
-
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