Improvements and finalization of dynamically resizable routers, replaces ActorPool. See 1557

* resize on nth message instead of always each message
* improved pressure evaluation
* more tests
* documentation
* removed ActorPool
This commit is contained in:
Patrik Nordwall 2012-01-10 15:53:27 +01:00
parent 8b71bf5bea
commit 19845d93e8
21 changed files with 591 additions and 1226 deletions

View file

@ -5,6 +5,7 @@ package akka.docs.routing
import akka.routing.RoundRobinRouter
import akka.actor.{ ActorRef, Props, Actor, ActorSystem }
import akka.routing.DefaultResizer
case class Message1(nbr: Int)
@ -31,4 +32,12 @@ object RoutingProgrammaticallyExample extends App {
RoundRobinRouter(routees = routees)))
//#programmaticRoutingRoutees
1 to 6 foreach { i router2 ! Message1(i) }
//#programmaticRoutingWithResizer
val resizer = DefaultResizer(lowerBound = 2, upperBound = 15)
val router3 = system.actorOf(Props[ExampleActor1].withRouter(
RoundRobinRouter(resizer = Some(resizer))))
//#programmaticRoutingWithResizer
1 to 6 foreach { i router3 ! Message1(i) }
}