What you describe is exactly a feature we just rolled out in Akka 2.5.0 :-) Docs here: http://doc.akka.io/docs/akka/2.5/scala/actors.html#Coordinated_Shutdown It also handles other parts of Akka, such as cluster singletons, Akka HTTP and more.
Akka 2.5 is binary compatible with 2.4 (except if a library touched some specific internals / private APIs - see the release notes for details), so you should be able to quickly hop onto it :-) Happy hakking! -- Konrad `ktoso` Malawski Akka <http://akka.io> @ Lightbend <http://lightbend.com> On 18 April 2017 at 14:31:24, Arno Haase ([email protected]) wrote: When shutting down an ActorSystem, I would like to shut down a ShardRegion in three phases to ensure consistency: 1. Prevent sharded entities from receiving any new commands 2. Let the sharded entities finish their work 3. Actually shut down the ShardRegion, stopping all sharded entities and allowing other shards to start this shard's entities To give some context, in my case command processing involves some interaction between sharded entities and other actors (e.g. updating an ElasticSearch index), so step 2 involves more than just stopping the sharded entity actor. This looks like a common problem, but I found no API for doing step 1 without stopping sharded entity actors. In particular, sending GracefulShutdown to the ShardRegion appears to do 1. and 3. without allowing the application code to do 2. Am I missing something? Any help is appreciated. - Arno -- >>>>>>>>>> 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 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.
