Akka contextual viewing / unlocking takes place before the relationship

I have the following sequential actions on two members: parent P and child C :

  • P clock C ( context watch c )
  • P unatches C ( context unwatch c )
  • P correctly stops C ( c ! PoisonPill )

What i want to know; I'm sure P is not getting Terminated event for C ?

Here is a sample code snippet

 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] } 
+6
source share
1 answer

No, there is no such guarantee.

+4
source

Source: https://habr.com/ru/post/915703/


All Articles