Removing Channel(s), tryTell etc, everything compiles but all tests are semibroken
This commit is contained in:
parent
cccf6b4ed9
commit
1b730b5c82
96 changed files with 353 additions and 742 deletions
|
|
@ -8,9 +8,9 @@ import akka.actor.Actor._
|
|||
import akka.event.EventHandler
|
||||
import System.{ currentTimeMillis ⇒ now }
|
||||
import akka.routing.Routing.Broadcast
|
||||
import akka.actor.{ Timeout, Channel, Actor, PoisonPill }
|
||||
import akka.routing._
|
||||
import akka.AkkaApplication
|
||||
import akka.actor.{ ActorRef, Timeout, Actor, PoisonPill }
|
||||
|
||||
object Pi extends App {
|
||||
|
||||
|
|
@ -40,8 +40,7 @@ object Pi extends App {
|
|||
}
|
||||
|
||||
def receive = {
|
||||
case Work(arg, nrOfElements) ⇒
|
||||
channel ! Result(calculatePiFor(arg, nrOfElements)) // perform the work
|
||||
case Work(arg, nrOfElements) ⇒ sender ! Result(calculatePiFor(arg, nrOfElements)) // perform the work
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -67,11 +66,11 @@ object Pi extends App {
|
|||
for (arg ← 0 until nrOfMessages) router ! Work(arg, nrOfElements)
|
||||
|
||||
//Assume the gathering behavior
|
||||
this become gather(channel)
|
||||
this become gather(sender)
|
||||
}
|
||||
|
||||
// phase 2, aggregate the results of the Calculation
|
||||
def gather(recipient: Channel[Any]): Receive = {
|
||||
def gather(recipient: ActorRef): Receive = {
|
||||
case Result(value) ⇒
|
||||
// handle result from the worker
|
||||
pi += value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue