remove ActorRef.stop()

- replace ActorRef.stop() by ActorRefFactory.stop(child) everywhere
- ActorCell “optimizes” this to remove the child from its childrenRefs
  in order to allow immediate recycling of the name
- the lost soul must have a place, for which the Locker has been
  created, where Davy Jones will happily rebind the soul to his ship
  (i.e. set “parent” to the locker to avoid mem leak) and periodically
  revisit it (.stop(), in case of that being lost in comm failure,
  similar .watch() to re-check liveness)
This commit is contained in:
Roland 2011-12-14 00:06:36 +01:00
parent 7da61b6cc1
commit cb85778b12
67 changed files with 328 additions and 238 deletions

View file

@ -40,7 +40,7 @@ class FirstActor extends Actor {
case DoIt(msg)
val replyMsg = doSomeDangerousWork(msg)
sender ! replyMsg
self.stop()
context.stop(self)
}
def doSomeDangerousWork(msg: ImmutableMessage): String = { "done" }
})) ! m
@ -143,7 +143,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
//#import-context
val first = system.actorOf(Props(new FirstActor))
first.stop()
system.stop(first)
}
@ -169,7 +169,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
system.eventStream.unsubscribe(testActor)
system.eventStream.publish(TestEvent.UnMute(filter))
myActor.stop()
system.stop(myActor)
}
"creating actor with constructor" in {
@ -182,7 +182,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
val myActor = system.actorOf(Props(new MyActor("...")))
//#creating-constructor
myActor.stop()
system.stop(myActor)
}
"creating actor with Props" in {
@ -192,7 +192,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
val myActor = system.actorOf(Props[MyActor].withDispatcher(dispatcher), name = "myactor")
//#creating-props
myActor.stop()
system.stop(myActor)
}
"using ask" in {
@ -214,7 +214,7 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
val result: Option[Int] = for (x (myActor ? 3).as[Int]) yield { 2 * x }
//#using-ask
myActor.stop()
system.stop(myActor)
}
"using receiveTimeout" in {