У меня есть следующие последовательные действия над двумя актерами, родителемPи дочернимC:
отслеживание контекста c
)контекст unwatch c
)c ! PoisonPill
)Я хочу знать следующее; Гарантирую ли я, что Pне получит событие Terminated
для C?
Вот пример кода
class HappensBefore extends App {
class C extends Actor { def receive = {} }
class P extends Actor {
val c = context actorOf Props[C]
context watch c
context unwatch c
c ! PoisonPill
def receive = { case Terminated(child) => println("Oh Noes!") }
}
ActorSystem("test") actorOf Props[P]
}