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:
parent
e3bd02b82c
commit
a4dd6b7547
6 changed files with 235 additions and 29 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue