Remove SelfActorRef and use ActorContext to access state in ActorInstance. See #1202

- removed SelfActorRef
- added an ActorContext interface that provides a view into ActorInstance
- the ActorInstance (as ActorContext) gets injected into the Actor
- moved self methods like sender and reply directly to the Actor
This commit is contained in:
Peter Vlugter 2011-09-19 11:22:27 +02:00
parent d926b05fae
commit 7b1cdb4457
96 changed files with 476 additions and 542 deletions

View file

@ -38,7 +38,7 @@ object Pi extends App {
def receive = {
case Work(arg, nrOfElements)
self reply Result(calculatePiFor(arg, nrOfElements)) // perform the work
reply(Result(calculatePiFor(arg, nrOfElements))) // perform the work
}
}
@ -66,7 +66,7 @@ object Pi extends App {
for (arg 0 until nrOfMessages) router ! Work(arg, nrOfElements)
//Assume the gathering behavior
this become gather(self.channel)
this become gather(channel)
}
// phase 2, aggregate the results of the Calculation