RateLimitResetEvent class final
Event published when a rate limit window has been reset for a particular entity.
Observers can use this event to:
- Track resets for monitoring or alerting.
- Reset related metrics counters.
- Inform clients that they can resume requests without hitting the limit.
This event is a subclass of RateLimitEvent and carries:
source: The identifier of the entity affected by the reset (e.g., user ID, IP address, API key).- limitName: The name of the rate-limited resource or bucket (e.g.,
"login_attempts"). - resetTime: The timestamp at which the rate limit window was reset.
timestamp: Optional time at which the event occurred; defaults to the current time.
Example
final resetEvent = RateLimitResetEvent('user:42', 'login_attempts', DateTime.now());
eventPublisher.publish(resetEvent);
Related Components
- RateLimitAllowedEvent: Indicates a request was allowed.
- RateLimitDeniedEvent: Indicates a request was denied due to rate limiting.
- RateLimitMetrics: Can be updated when a reset occurs.
- Inheritance
-
- Object
- RateLimitEvent
- RateLimitResetEvent
Constructors
- RateLimitResetEvent(Object source, String limitName, DateTime resetTime, [DateTime? timestamp])
-
Creates a new event indicating the rate limit window has been reset.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- limitName → String
-
The name of the rate-limited resource or bucket.
finalinherited
- resetTime → DateTime
-
The timestamp when the rate limit was reset.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode, andtoString.inherited -
getPackageName(
) → String -
Represents an abstraction for identifying the package that an object,
resource, or service belongs to.
inherited
-
getSource(
) → Object -
Returns the source of the event.
inherited
-
getTimestamp(
) → DateTime -
Returns the timestamp of the event.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
toStringOptions(
) → ToStringOptions -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited