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
Currently there's no API for that. You can see how it would be implemented by looking at AcquireScript in RedisSemaphorePrimitive.cs; the first part is checking the count.
So one option is implementing a similar script in your code.
I also think it would be reasonable to add an API to RedisDistributedSemaphore for this:
public int GetCurrentCount();
public ValueTask<int> GetCurrentCountAsync();
I'd be happy to review and accept such a contribution.
Activity
madelson commentedon Jan 4, 2025
Currently there's no API for that. You can see how it would be implemented by looking at AcquireScript in RedisSemaphorePrimitive.cs; the first part is checking the count.
So one option is implementing a similar script in your code.
I also think it would be reasonable to add an API to RedisDistributedSemaphore for this:
I'd be happy to review and accept such a contribution.
teesofttech commentedon Jul 31, 2025
Hi
Can I contribute to this?
You can assign it to me @madelson
madelson commentedon Aug 10, 2025
Released in 2.7. Thanks @teesofttech for your contribution!