Merge branch 'wip-2134-deathwatch2.0-√' of github.com:akka/akka into wip-2134-deathwatch2.0-√
This commit is contained in:
commit
e461e1490d
2 changed files with 15 additions and 14 deletions
|
|
@ -502,8 +502,6 @@ class LocalActorRefProvider(
|
||||||
def init(_system: ActorSystemImpl) {
|
def init(_system: ActorSystemImpl) {
|
||||||
system = _system
|
system = _system
|
||||||
// chain death watchers so that killing guardian stops the application
|
// chain death watchers so that killing guardian stops the application
|
||||||
//guardian.sendSystemMessage(Watch(systemGuardian, guardian))
|
|
||||||
//rootGuardian.sendSystemMessage(Watch(rootGuardian, systemGuardian))
|
|
||||||
guardian.sendSystemMessage(Watch(guardian, systemGuardian))
|
guardian.sendSystemMessage(Watch(guardian, systemGuardian))
|
||||||
rootGuardian.sendSystemMessage(Watch(systemGuardian, rootGuardian))
|
rootGuardian.sendSystemMessage(Watch(systemGuardian, rootGuardian))
|
||||||
eventStream.startDefaultLoggers(_system)
|
eventStream.startDefaultLoggers(_system)
|
||||||
|
|
|
||||||
|
|
@ -246,22 +246,25 @@ private[akka] final class PromiseActorRef private (val provider: ActorRefProvide
|
||||||
|
|
||||||
override def !(message: Any)(implicit sender: ActorRef = null): Unit = state match {
|
override def !(message: Any)(implicit sender: ActorRef = null): Unit = state match {
|
||||||
case Stopped | _: StoppedWithPath ⇒ provider.deadLetters ! message
|
case Stopped | _: StoppedWithPath ⇒ provider.deadLetters ! message
|
||||||
case _ ⇒
|
case _ ⇒ if (!(result.tryComplete {
|
||||||
val completedJustNow = result.tryComplete {
|
message match {
|
||||||
message match {
|
case Status.Success(r) ⇒ Right(r)
|
||||||
case Status.Success(r) ⇒ Right(r)
|
case Status.Failure(f) ⇒ Left(f)
|
||||||
case Status.Failure(f) ⇒ Left(f)
|
case other ⇒ Right(other)
|
||||||
case other ⇒ Right(other)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!completedJustNow) provider.deadLetters ! message
|
})) provider.deadLetters ! message
|
||||||
}
|
}
|
||||||
|
|
||||||
override def sendSystemMessage(message: SystemMessage): Unit = message match {
|
override def sendSystemMessage(message: SystemMessage): Unit = message match {
|
||||||
case _: Terminate ⇒ stop()
|
case _: Terminate ⇒ stop()
|
||||||
case Watch(watchee, watcher) ⇒ if (watchee == this && watcher != this && !addWatcher(watcher)) watcher ! Terminated(watchee)(stopped = true)
|
case Watch(watchee, watcher) ⇒
|
||||||
case Unwatch(watchee, watcher) ⇒ if (watchee == this && watcher != this) remWatcher(watcher)
|
if (watchee == this && watcher != this) {
|
||||||
case _ ⇒
|
if (!addWatcher(watcher)) watcher ! Terminated(watchee)(stopped = true)
|
||||||
|
} else System.err.println("BUG: illegal Watch(%s,%s) for %s".format(watchee, watcher, this))
|
||||||
|
case Unwatch(watchee, watcher) ⇒
|
||||||
|
if (watchee == this && watcher != this) remWatcher(watcher)
|
||||||
|
else System.err.println("BUG: illegal Unwatch(%s,%s) for %s".format(watchee, watcher, this))
|
||||||
|
case _ ⇒
|
||||||
}
|
}
|
||||||
|
|
||||||
override def isTerminated: Boolean = state match {
|
override def isTerminated: Boolean = state match {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue