May 2017
Intermediate to advanced
414 pages
13h
English
In this recipe, we covered how to create a shutdown pattern to terminate an actor system once all actors are terminated. To achieve this, we create another actor called reaper that watches all other actors and holds their actorRefs. Once all actors are terminated, it proceeds to terminate the actor system. To make this intuitive, we create a helper trait named ReaperAwareActor that overrides the preStart method to send a message to the reaper with the actorRef. We do this using actorSelection. This has a few requirements:
These implications can bring ...
Read now
Unlock full access