Thanks Rafal for the clarification sure, I think, I will go with 1st one,
On Wed, Nov 2, 2016 at 3:52 PM, Rafał Krzewski <[email protected]> wrote: > W dniu środa, 2 listopada 2016 18:28:22 UTC+1 użytkownik Harinath > Mallepally napisał: >> >> Hi Rafal, >> >> How do I get to stop my actor, if i want to? looks like I don't see an >> option. we have defined actors that do certain activities when ordered to >> do so and have life cycle, so we create and then when we are done with it, >> we are stopping too. trying to avoid use deprecated methods now. >> > > There are multiple ways: > - actor can stop itself by calling context.stop(self) > - actor can be stopped by it's parent - actor can access ActorRefs of all > child actors it creates (context.childen, context.child(name: String)) > - actor can be stopped automatically when it's parent is stopped > - you can send an akka.actor.PoisonPill message to an actor to stop it > > Usually the first way is recommended: upon reaching a certain state (after > receiving all pending confirmations, a timeout etc depending on use case) > actor stops itself. > > cheers, > Rafał > > >> >> the ActorSystem.stop takes a ActorRef as input and not ActorSelection. >> Also [1] says we preferable method to communicate with Actor is through >> ActorRef and not through ActorSelection is this correct? >> >> Thanks >> Hari >> >> 1. http://doc.akka.io/docs/akka/2.4/java/untyped-actors.html >> #Identifying_Actors_via_Actor_Selection >> >> >> -- > >>>>>>>>>> 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 a topic in the > Google Groups "Akka User List" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/akka-user/_nOT9QbkcbA/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >>>>>>>>>> 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 https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
