aspnetcore-redis-rate-limiting
aspnetcore-redis-rate-limiting copied to clipboard
Unable to get whether permits are exhausted / wait until permits are replenished
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.