Lifecycle monitoring

Besides SupervisorStrategy, there is another way to monitor the actor lifecycle. The monitoring strategy provides a mechanism where any actor can listen to certain events on another actor. Based on these events, the listening actor can direct another actor or it can take decisions on how to handle the actor termination. Some of the guidelines when lifecycle monitoring is required are as follows:

  • The actor monitoring is usually used when the actors in question are not part of your hierarchy. So actors at the horizontal level are primarily the candidates for monitoring.
  • When the supervisor wants to terminate the child actors instead of just restarting (in order to clear the mailbox attached to the actors), monitoring on the actor's ...

Get Akka Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.