-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
Added the MOVE command to finagle-redis. #267
Changes from 1 commit
dc1a8c3
ba50018
77b72fe
104126f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,21 @@ trait Keys { self: BaseClient => | |
case EmptyMBulkReply() => Future.Nil | ||
} | ||
|
||
/** | ||
* Move key from the currently selected database to the specified destination | ||
* database. When key already exists in the destination database, or it does | ||
* not exist in the source database, it does nothing. | ||
* | ||
* @param key, db | ||
* @return true if key was moved. | ||
* false if key was not moved for any reason. | ||
* @see http://redis.io/commands/move | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is implicit. If you think it's useful to point out in the scaladocs that users can find more details in the redis protocol documentation, let's just stick it in a package.scala file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not biased in any direction here - from looking through the *Command.scala files for guidance, I saw what seemed to be a bit of a mixed bag on the scaladocs. There was one usage of Me personally, I figure if someone is using a redis driver they know what the Redis Command is, so I would simply do something like this /**
* Move key from the currently selected database to the specified destination
* database. When key already exists in the destination database, or it does
* not exist in the source database, it does nothing.
*
* @param key, db
* @return true if key was moved.
* false if key was not moved for any reason.
*/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's drop it then. 🤘 |
||
*/ | ||
def move(key: ChannelBuffer, db: ChannelBuffer): Future[JBoolean] = | ||
doRequest(Move(key,db)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be: |
||
case IntegerReply(n) => Future.value(n == 1) | ||
} | ||
|
||
/** | ||
* Set a key's time to live in milliseconds. | ||
* | ||
|
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.
Only one space after the *