Hi Sean, 29 jul 2014 kl. 15:00 skrev Sean Zhong <[email protected]>:
> Hi Roland, > > Yes, you are right, the task need to send a explicit "TASK_SUCESS_FINISH" > message to notify the subscribe that task finish normally, all other cases is > abnormal. The only pain point in this case is that I have to write the > subscription twice. First the subscriber register it self as a subscriber so > that it can receive "TASK_SUCESS_FINISH" message, second it also need to > context.watch to watch for abnormal termination. Yes, this is true: the request can “end” in two fundamentally different ways. > Another good use case of addressTerminated=true is that I can notify the > system user probably the network is down, and need to be checked. For this I’d recommend just listening for remote lifecycle events on the EventStream, that can be done centrally by just one actor in the ActorSystem. Regards, Roland > > > > On Sunday, July 27, 2014 5:17:23 PM UTC+8, rkuhn wrote: > The question then is: which meaning do you attribute to that flag in the > context of your application? Because receiving a Terminated with > addressTerminated=true does not preclude that the actor meanwhile terminated > normally on the partitioned remote node—you simply cannot know. > > What I am getting at is that you can choose to optimize those two cases > differently, but as soon as your program depends on this boolean for > correctness you are in trouble. > > Regards, > > Roland > > 26 jul 2014 kl. 21:21 skrev Sean Zhong <[email protected]>: > >> Ah, I find out! >> >> addressTerminated seems to server this purpose. >> >> addressTerminated the Terminated message was derived from that the remote >> node hosting the watched actor was detected as unreachable >> >> Terminated private[akka] (@BeanProperty actor: ActorRef)( >> @BeanProperty val existenceConfirmed: Boolean, >> @BeanProperty val addressTerminated: Boolean) >> >> On Sunday, July 27, 2014 2:55:38 AM UTC+8, Sean Zhong wrote: >> fix typo >> >> A remote supervise B, A watch B >> >> There are two scenarios: >> 1. normal: inside B, call context.stop(self) when B finish its work >> 2. abnormal: the network connection between A and B is down >> >> A will receive a Terminated message, how can A know the Terminated message >> is caused by "1" or "2"? >> >> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: >> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. > > > > Dr. Roland Kuhn > Akka Tech Lead > Typesafe – Reactive apps on the JVM. > twitter: @rolandkuhn > > > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. Dr. Roland Kuhn Akka Tech Lead Typesafe – Reactive apps on the JVM. twitter: @rolandkuhn -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
