+act #3663 Package BalancingDispatcher for usage in router pool

* In fact, make it easy to define any dedicated dispatcher for a pool
This commit is contained in:
Patrik Nordwall 2013-10-16 13:02:35 +02:00
parent f6179da523
commit 80892762ad
22 changed files with 140 additions and 47 deletions

View file

@ -317,12 +317,11 @@ public class RouterDocTest {
public void demonstrateDispatcher() {
//#dispatchers
Props props =
// head will run on "router-dispatcher" dispatcher
new RoundRobinPool(5).withDispatcher("router-dispatcher").props(
Props.create(Worker.class))
// Worker routees will run on "workers-dispatcher" dispatcher
.withDispatcher("workers-dispatcher");
ActorRef router = system.actorOf(props);
// head router actor will run on "router-dispatcher" dispatcher
// Worker routees will run on "pool-dispatcher" dispatcher
new RandomPool(5).withDispatcher("router-dispatcher").props(
Props.create(Worker.class));
ActorRef router = system.actorOf(props, "poolWithDispatcher");
//#dispatchers
}
@ -390,8 +389,8 @@ public class RouterDocTest {
public void demonstrateRemoteDeploy() {
//#remoteRoutees
Address[] addresses = {
new Address("akka", "remotesys", "otherhost", 1234),
AddressFromURIString.parse("akka://othersys@anotherhost:1234")};
new Address("akka.tcp", "remotesys", "otherhost", 1234),
AddressFromURIString.parse("akka.tcp://othersys@anotherhost:1234")};
ActorRef routerRemote = system.actorOf(
new RemoteRouterConfig(new RoundRobinPool(5), addresses).props(
Props.create(Echo.class)));