We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I noticed that the python redis library will raise an exception when you are watching any key.
In my opinion, think is quite useful when you are inside loops and using watch method.
watch
Here is an example:
while Time.now.to_i < threshold do begin client.watch("market:", buyer) do price = client.zscore("market:", item).to_i funds = client.hget(buyer, 'funds') if price != seller_price || price > funds client.unwatch break end client.multi do |multi| multi.hincrby(seller, 'funds', price) multi.hincrby(buyer, 'funds', price * -1) multi.sadd(inventory, itemid) multi.zrem('market:', item) end break end rescue Redis::WatchError next end end
I would like to know if you think it something useful and if so I do not mind working on a PR to add it
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I noticed that the python redis library will raise an exception when you are watching any key.
In my opinion, think is quite useful when you are inside loops and using
watch
method.Here is an example:
I would like to know if you think it something useful and if so I do not mind working on a PR to add it
The text was updated successfully, but these errors were encountered: