Rename a few things, see #944

* hashKey
* hashMapping ConsistentHashMapping
* withHashMapper ConsistentHashMapper
This commit is contained in:
Patrik Nordwall 2012-09-17 13:24:13 +02:00
parent b4f5948340
commit 64a1fb0235
6 changed files with 54 additions and 51 deletions

View file

@ -42,20 +42,20 @@ class ConsistentHashingRouterDocSpec extends AkkaSpec with ImplicitSender {
//#consistent-hashing-router
import akka.actor.Props
import akka.routing.ConsistentHashingRouter
import akka.routing.ConsistentHashingRouter.ConsistentHashRoute
import akka.routing.ConsistentHashingRouter.ConsistentHashMapping
import akka.routing.ConsistentHashingRouter.ConsistentHashableEnvelope
def consistentHashRoute: ConsistentHashRoute = {
def hashMapping: ConsistentHashMapping = {
case Evict(key) key
}
val cache = system.actorOf(Props[Cache].withRouter(ConsistentHashingRouter(10,
consistentHashRoute = consistentHashRoute)), name = "cache")
hashMapping = hashMapping)), name = "cache")
cache ! ConsistentHashableEnvelope(
message = Entry("hello", "HELLO"), consistentHashKey = "hello")
message = Entry("hello", "HELLO"), hashKey = "hello")
cache ! ConsistentHashableEnvelope(
message = Entry("hi", "HI"), consistentHashKey = "hi")
message = Entry("hi", "HI"), hashKey = "hi")
cache ! Get("hello")
expectMsg(Some("HELLO"))