RateLimiterInterface
interface RateLimiterInterface (View source)
Limits repeated events by opaque caller-defined keys without exposing storage details.
Methods
status(string $key, string $scope, RateLimitPolicy $policy)
Returns the current bucket state without recording an attempt.
hit(string $key, string $scope, RateLimitPolicy $policy)
Atomically records one attempt and returns the resulting bucket state.
clear(string $key)
Removes the bucket associated with one opaque key.
void
Details
status
RateLimitResult
status(string $key, string $scope, RateLimitPolicy $policy)
Returns the current bucket state without recording an attempt.
Scope is validated diagnostic metadata only; it does not affect bucket identity.
hit
RateLimitResult
hit(string $key, string $scope, RateLimitPolicy $policy)
Atomically records one attempt and returns the resulting bucket state.
Scope records safe diagnostic metadata without affecting bucket identity.
clear
void
clear(string $key)
Removes the bucket associated with one opaque key.