etaty / rediscala

Non-blocking, Reactive Redis driver for Scala (with Sentinel support)
Apache License 2.0
790 stars 142 forks source link

name property for RedisServer #146

Open redlion99 opened 8 years ago

redlion99 commented 8 years ago

Add name property for RedisServer, so it's possible to add multi connection in the pool for a single server.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 92.502% when pulling 4ab3d2336e655b74409788f30c0b5de3b1574ca0 on redlion99:master into f1c1101a87ebe858f7bcd6b4222e4698c06524df on etaty:master.

etaty commented 8 years ago

Thanks Could you post a gist to help me understand the use case?

redlion99 commented 8 years ago

Sometimes we need to create more than one connection for a single server. without the name property if we setup a pool like

RedisClientPool( RedisServer("localhost"), RedisServer("localhost"))

We just get one active connection in the pool, because the case class in the key of the connection map has the same hashcode.

if we have a name property it works like this:

RedisClientPool( RedisServer("localhost", name = "a"), RedisServer("localhost", name = "b"))