-
Notifications
You must be signed in to change notification settings - Fork 85
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
Cleanup storehaus-redis #328
Conversation
This will be made better once #310 is done. |
@@ -45,7 +44,7 @@ class RedisHashStore(val client: Client, ttl: Option[Duration]) | |||
extends Store[ChannelBuffer, Map[ChannelBuffer, ChannelBuffer]] { | |||
|
|||
override def get(k: ChannelBuffer): Future[Option[Map[ChannelBuffer, ChannelBuffer]]] = | |||
client.hGetAll(k).map({ case e if (e.isEmpty) => None case xs => Some(Map(xs:_*)) }) | |||
client.hGetAll(k).map { case e if e.isEmpty => None case xs => Some(Map(xs: _*)) } |
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.
can we make two lines:
.map {
case e if e.isEmpty => None
case xs => Some(Map(xs: _*))
}
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.
done 👍
ping @johnynek 😄 |
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.
sorry, I had a comment, but somehow it didn't get submitted. Maybe we don't have to fix it now, but we should file an issue, or maybe you can correct my understanding.
@@ -34,7 +33,8 @@ object RedisSortedSetStore { | |||
*/ | |||
class RedisSortedSetStore(client: Client) | |||
extends MergeableStore[ChannelBuffer, Seq[(ChannelBuffer, Double)]] { | |||
def semigroup = implicitly[Semigroup[Seq[(ChannelBuffer, Double)]]] | |||
def semigroup: Semigroup[Seq[(ChannelBuffer, Double)]] = | |||
implicitly[Semigroup[Seq[(ChannelBuffer, Double)]]] |
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.
Is this really the semigroup that redis is doing? I tend to doubt it. Seems like the value is more like Map[ChannelBuffer, Double]
. Can we add a test that the semigroup we declare here is consistent with how redis works?
We could do that by comparing .multiMerge
here on a big set of items to what we would get from MergeableStore.fromStore
and using the semigroup here.
No description provided.