Implemented SmallestMailboxRouter. See #1619
This commit is contained in:
parent
86265b2118
commit
6a12fb7876
10 changed files with 322 additions and 55 deletions
|
|
@ -8,6 +8,7 @@ import annotation.tailrec
|
|||
import akka.actor.{ Props, Actor }
|
||||
import akka.util.duration._
|
||||
import akka.dispatch.Await
|
||||
import akka.routing.SmallestMailboxRouter
|
||||
|
||||
case class FibonacciNumber(nbr: Int)
|
||||
|
||||
|
|
@ -59,6 +60,14 @@ class ParentActor extends Actor {
|
|||
i ⇒ randomRouter ! i
|
||||
}
|
||||
//#randomRouter
|
||||
case "smr" ⇒
|
||||
//#smallestMailboxRouter
|
||||
val smallestMailboxRouter =
|
||||
context.actorOf(Props[PrintlnActor].withRouter(SmallestMailboxRouter(5)), "router")
|
||||
1 to 10 foreach {
|
||||
i ⇒ smallestMailboxRouter ! i
|
||||
}
|
||||
//#smallestMailboxRouter
|
||||
case "br" ⇒
|
||||
//#broadcastRouter
|
||||
val broadcastRouter =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue