Akka context watch/unwatch happens-before relationship
actor, akka, concurrency, happens-before, scala
Solution
No, there is no such guarantee.
Problem
I have the following sequential actions on two actors, a parent P and a child C: - P watches C (`context watch c`) - P unwatches C (`context unwatch c`) - P stops C gracefully (`c ! PoisonPill`) What I want to know is; am I guaranteed that P does not receive a `Terminated` event for C? Here's a sample piece of code ``` 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] } ```