-
Notifications
You must be signed in to change notification settings - Fork 0
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
support full set of redis hash commands #20 #21
Conversation
modules/api/src/main/scala/com/github/scoquelin/arugula/commands/RedisHashAsyncCommands.scala
Outdated
Show resolved
Hide resolved
modules/api/src/main/scala/com/github/scoquelin/arugula/commands/RedisHashAsyncCommands.scala
Outdated
Show resolved
Hide resolved
I think I uncovered a Lettuce bug while testing. If you call |
converted all the responses to List instead of Seq. I also changed some of the inputs to List but perhaps that is a step too far? Accepting Seq or Iterable as an input is probably acceptable. I could change those input changes back to Seq or Iterable even? |
/** | ||
* Get the values of multiple hash fields | ||
* @param key The key | ||
* @param fields The fields | ||
* @return A map of field -> value for each field that exists or None if the field does not exist | ||
*/ | ||
def hMGet(key: K, fields: K*): Future[ListMap[K, Option[V]]] | ||
|
||
/** | ||
* Get the values of multiple hash fields | ||
* @param key The key | ||
* @param fields The fields | ||
* @return A map of field -> value for each field that exists or None if the field does not exist | ||
*/ | ||
def hMGet(key: K, fields: => List[K]): Future[Map[K, Option[V]]] |
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.
Should we keep both methods since they seem to achieve the same operation ?
Could we do maybe def hMGet(key: K, fields: K*): Future[Map[K, Option[V]]]
only so that it's more in line with other operations ?
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.
I personally hate the fields: K*
approach since it prevents adding additional parameters later. Since that is unlikely to happen though, yeah I can get rid of the def hMGet(key: K, fields: => List[K])
signature.
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.
okay, I removed the def hMGet(key: K, fields: => List[K])
signature and left the other one. That should resolve the open issues.
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.
Thanks for pushing hard on the hash commands! 🚀
implemented all the hash commands.
I did not support streaming with hscan, we can leave that for a future implementation. Want to use reactive streams pattern.