aspnetcore-redis-rate-limiting icon indicating copy to clipboard operation
aspnetcore-redis-rate-limiting copied to clipboard

Unable to get whether permits are exhausted / wait until permits are replenished

Open guynoga47 opened this issue 2 years ago • 0 comments

According to the definitions of AttemptAcquire and AcquireAsync, when given permitCount = 0, it is possible to check if the permits are exhausted or wait until the permits are replenished, respectively.

Here are the links to the definitions:

https://learn.microsoft.com/en-us/dotnet/api/system.threading.ratelimiting.ratelimiter.attemptacquire?view=aspnetcore-7.0

https://learn.microsoft.com/en-us/dotnet/api/system.threading.ratelimiting.ratelimiter.acquireasync?view=aspnetcore-7.0

I would be happy to know if there is any workaround to check the actual state of the permits without acquiring a lease.

guynoga47 avatar Feb 20 '23 08:02 guynoga47