You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API proposal for the feature request on the .NET side for this is in dotnet/aspnetcore#45658 and seems to be going into another direction.
There's a IRateLimiterStatisticsFeature portion which is actually intended to provide info for rate limit headers but it seems the discussion got bogged down on the specifics of that. TBO I am unsure whether it can even be made to work as well as the lease metadata approach for most of the limiters here. I think the thing that might be available the quickest is the part of the proposal that introduces a IRateLimiterLeaseFeature. That would make the lease available from middleware solving this issue here.
Lets see if they are up for my proposal to advance the IRateLimiterLeaseFeature independently.
Custom middleware
public interface IRateLimiterPolicy<TPartitionKey> { Func<OnRejectedContext, CancellationToken, ValueTask>? OnRejected { get; } + Func<OnAcquiredContext, CancellationToken, ValueTask>? OnAcquired { get; } }
public sealed class RateLimiterOptions { public Func<OnRejectedContext, CancellationToken, ValueTask>? OnRejected { get; set; } + public Func<OnAcquiredContext, CancellationToken, ValueTask>? OnAcquired { get; set; } }
dotnet/aspnetcore#44140
The text was updated successfully, but these errors were encountered: