Thanks !!! this is exactly what I was looking for Sincerely, Avi Levi m: +972-52-3459959 <https://www.linkedin.com/in/leviavi> https://il.linkedin.com/in/leviavi
2017-05-08 7:44 GMT+03:00 Patrik Nordwall <[email protected]>: > No, use Cluster Singleton http://doc.akka.io/docs/akka/ > 2.5/scala/cluster-singleton.html > > /Patrik > mån 8 maj 2017 kl. 05:07 skrev AL <[email protected]>: > >> I am starting to use AKKA cluster. >> >> I would like that a certain task will be performed by a single actor in >> the cluster. If that actor is down, it should be performed by other actor. >> I thought to accomplish that by tracking the LeaderChanged event and check >> if the current Actor is the leader. Something like >> >> case LeaderChanged => if ((cluster.state.leader.map(_ == >> cluster.selfAddress).getOrElse(false)) >> //do some task >> >> is that the idiomatic way to do it ? >> >> -- >> >>>>>>>>>> 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. >> > -- > >>>>>>>>>> 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/8AiLKHDPcX8/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.
