Support partial function to map message to hash key, see #944

* Partial function, ConsistentHashRoute, for Scala API
* withConsistentHashMapping ConsistentHashMapping for
  Java API
* Updated documentation
This commit is contained in:
Patrik Nordwall 2012-09-14 13:47:58 +02:00
parent e3bd02b82c
commit a4dd6b7547
6 changed files with 235 additions and 29 deletions

View file

@ -19,9 +19,12 @@ object ConsistentHashingRouterDocSpec {
def receive = {
case Entry(key, value) cache += (key -> value)
case Get(key) sender ! cache.get(key)
case Evict(key) => cache -= key
}
}
case class Evict(key: String)
case class Get(key: String) extends ConsistentHashable {
override def consistentHashKey: Any = key
}