make everything except tutorial-second compile
someone should look at remoting vs. timeout (i.e. which is sent around), because I removed that in some places. It might simply be irrelevant once we remove the Future special-casing.
This commit is contained in:
parent
93b1ef3703
commit
14751f7d29
22 changed files with 300 additions and 254 deletions
|
|
@ -9,8 +9,11 @@ import Actor._
|
|||
import java.util.concurrent.CountDownLatch
|
||||
import akka.routing.Routing.Broadcast
|
||||
import akka.routing.{ RoutedProps, Routing }
|
||||
import akka.AkkaApplication
|
||||
|
||||
object Pi extends App {
|
||||
|
||||
val app = AkkaApplication()
|
||||
|
||||
calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000)
|
||||
|
||||
|
|
@ -55,10 +58,10 @@ object Pi extends App {
|
|||
var start: Long = _
|
||||
|
||||
// create the workers
|
||||
val workers = Vector.fill(nrOfWorkers)(actorOf[Worker])
|
||||
val workers = Vector.fill(nrOfWorkers)(app.createActor[Worker])
|
||||
|
||||
// wrap them with a load-balancing router
|
||||
val router = Routing.actorOf(RoutedProps().withRoundRobinRouter.withConnections(workers), "pi")
|
||||
val router = app.routing.actorOf(RoutedProps().withRoundRobinRouter.withConnections(workers), "pi")
|
||||
|
||||
// message handler
|
||||
def receive = {
|
||||
|
|
@ -101,7 +104,7 @@ object Pi extends App {
|
|||
val latch = new CountDownLatch(1)
|
||||
|
||||
// create the master
|
||||
val master = actorOf(new Master(nrOfWorkers, nrOfMessages, nrOfElements, latch))
|
||||
val master = app.createActor(new Master(nrOfWorkers, nrOfMessages, nrOfElements, latch))
|
||||
|
||||
// start the calculation
|
||||
master ! Calculate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue