foreachChild instead of allChildren, see #2552
This commit is contained in:
parent
7d47091e59
commit
e7a075a0d9
2 changed files with 6 additions and 6 deletions
|
|
@ -10,7 +10,7 @@ import java.lang.{ UnsupportedOperationException, IllegalStateException }
|
||||||
import akka.serialization.{ Serialization, JavaSerializer }
|
import akka.serialization.{ Serialization, JavaSerializer }
|
||||||
import akka.event.EventStream
|
import akka.event.EventStream
|
||||||
import scala.annotation.tailrec
|
import scala.annotation.tailrec
|
||||||
import java.util.concurrent.{ ConcurrentHashMap }
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
import akka.event.LoggingAdapter
|
import akka.event.LoggingAdapter
|
||||||
import scala.concurrent.forkjoin.ThreadLocalRandom
|
import scala.concurrent.forkjoin.ThreadLocalRandom
|
||||||
import scala.collection.JavaConverters
|
import scala.collection.JavaConverters
|
||||||
|
|
@ -520,8 +520,8 @@ private[akka] class VirtualPathContainer(
|
||||||
|
|
||||||
def hasChildren: Boolean = !children.isEmpty
|
def hasChildren: Boolean = !children.isEmpty
|
||||||
|
|
||||||
def allChildren: Iterable[ActorRef] = {
|
def foreachChild(f: ActorRef ⇒ Unit) = {
|
||||||
import scala.collection.JavaConverters._
|
val iter = children.values.iterator
|
||||||
children.values.asScala
|
while (iter.hasNext) f(iter.next)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,11 +90,11 @@ private[akka] class RemoteSystemDaemon(system: ActorSystemImpl, _path: ActorPath
|
||||||
case TerminationHook ⇒
|
case TerminationHook ⇒
|
||||||
terminating.switchOn {
|
terminating.switchOn {
|
||||||
terminationHookDoneWhenNoChildren()
|
terminationHookDoneWhenNoChildren()
|
||||||
allChildren foreach system.stop
|
foreachChild { system.stop(_) }
|
||||||
}
|
}
|
||||||
|
|
||||||
case AddressTerminated(address) ⇒
|
case AddressTerminated(address) ⇒
|
||||||
allChildren foreach { case a: InternalActorRef if a.getParent.path.address == address ⇒ system.stop(a) }
|
foreachChild { case a: InternalActorRef if a.getParent.path.address == address ⇒ system.stop(a) }
|
||||||
|
|
||||||
case unknown ⇒ log.warning("Unknown message {} received by {}", unknown, this)
|
case unknown ⇒ log.warning("Unknown message {} received by {}", unknown, this)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue