Interface IRateLimitStateProvider
- Namespace
- RateLimitHeaders.Throttling
- Assembly
- RateLimitHeaders.dll
Provides read-only access to rate limit state information across all tracked endpoints.
public interface IRateLimitStateProvider
Remarks
This interface is passed to throttling algorithms that need to make decisions based on the overall rate limit state, not just a single endpoint.
Properties
TrackedEndpoints
Gets all tracked endpoint keys.
IEnumerable<string> TrackedEndpoints { get; }
Property Value
Methods
GetAllStates()
Gets the rate limit information for all tracked endpoints.
IEnumerable<RateLimitInfo> GetAllStates()
Returns
- IEnumerable<RateLimitInfo>
An enumerable of all currently tracked rate limit states.
GetRateLimitInfo(string)
Gets the rate limit information for a specific endpoint.
RateLimitInfo GetRateLimitInfo(string endpointKey)
Parameters
endpointKeystringThe endpoint key (e.g., "api.example.com/v1").
Returns
- RateLimitInfo
The rate limit info, or a default invalid instance if not tracked.