forked from redis/redis-rb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for new SETEX command (atomic SET+EXPIRE).
- Loading branch information
Showing
2 changed files
with
4 additions
and
5 deletions.
There are no files selected for viewing
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
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
41443f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey!
Michel and I were thinking that we may need to keep
set_with_expire
with the current implementation and addsetex
separately. Additionally, add a warning inset_with_expire
suggesting users to usesetex
.Otherwise we'd be breaking backwards compatibility for users who are not on Redis edge.
What do you think?
41443f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right, that is a better way to handle things :)
41443f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, so let us know when you have a new patch. Thanks again!
41443f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm kinda confused now whether the 2.x branch (now master) is meant to be run only with a Redis revision that supports
SETEX
. If it is, there's no need to supportset_with_expire
with the current implementation.Anyway, here's a shot: http://github.com/chuyeow/redis-rb/commits/setex (including an earlier commit that fixes a syntax error in Ruby 1.8.7).