Last active
August 29, 2015 14:15
-
-
Save miguelcma/99db5474150d097057ad to your computer and use it in GitHub Desktop.
redis: pipelined (multi) atomic get and del
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r.pipelined do | |
keys.each do |k| | |
r.multi do | |
values << r.get(k) | |
r.del(k) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment