I want to store in redis some int that will show the current load(pending request count).
I need this counter in redis to check if app should send request to underline service or not.
For example I have threshold 50 pending request. And if app already sent 50 request I have to throttle my request. Something similar to distributed semaphore.
I see that Redis has transaction. But it cannot return the value.
Can Redis help me with such case?
We had a similar requirement where we had to "Compare a value and increment it by 1" Atomically. We ended up using LUA script.
This maybe similar to what you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With