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:
parent
7da61b6cc1
commit
cb85778b12
67 changed files with 328 additions and 238 deletions
|
|
@ -76,7 +76,7 @@ abstract class AkkaSpec(_system: ActorSystem)
|
|||
protected def atTermination() {}
|
||||
|
||||
def spawn(body: ⇒ Unit)(implicit dispatcher: MessageDispatcher) {
|
||||
system.actorOf(Props(ctx ⇒ { case "go" ⇒ try body finally ctx.self.stop() }).withDispatcher(dispatcher)) ! "go"
|
||||
system.actorOf(Props(ctx ⇒ { case "go" ⇒ try body finally ctx.stop(ctx.self) }).withDispatcher(dispatcher)) ! "go"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ class AkkaSpecSpec extends WordSpec with MustMatchers {
|
|||
implicit val davyJones = otherSystem.actorOf(Props(new Actor {
|
||||
def receive = {
|
||||
case m: DeadLetter ⇒ locker :+= m
|
||||
case "Die!" ⇒ sender ! "finally gone"; self.stop()
|
||||
case "Die!" ⇒ sender ! "finally gone"; context.stop(self)
|
||||
}
|
||||
}), "davyJones")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue