Retrieves the current rate limiter state without modifying it. Returns the tracking metrics if the rate limiter exists, otherwise null.
Readable execution context for the operation
Unique identifier for the rate limiter
Current adapter state if found, or null if not yet initialized
Resets the rate limiter to its initial state. Clears all attempt tracking and lifts any blocking status. Can be called even if the rate limiter has expired or was never initialized.
Readable execution context for the operation
Unique identifier for the rate limiter to reset
Updates the rate limiter state and checks against the configured limit. Increments attempt counter and determines if the request should be allowed or blocked. The decision logic is handled by the policy interface configured for this adapter.
Readable execution context for the operation
Unique identifier for the rate limiter
Maximum allowed attempts in the current window
Updated state with incremented attempt and success flag
Low-level adapter contract for rate limiter implementations. Provides core operations for tracking attempts and enforcing limits according to the adapter's configured policy. This contract is not meant to be used directly; instead use
IRateLimiterFactory.The adapter works with a policy interface that determines the blocking algorithm (e.g., fixed-window, sliding-window). This separation allows multiple algorithm implementations to share the same storage layer.
IMPORT_PATH:
"@daiso-tech/core/rate-limiter/contracts"