Search code examples
akkaactorfault-toleranceakka-supervision

Does the child actor know that he is being resumed?


Imagine a straight-forward supervision hierarchy. The child dies. The father decides to Restart the child. When Restarted, the postRestart and friends are called, but what if the father had decided to resume the child? Does the child actor know that he is being resumed? And btw. does the father have access to the message that caused the exception in his child?


Solution

  • Resume means “nothing really happened, carry on” and in this spirit the child is not even informed. It is a directive which should rarely be used.

    The parent does only get the failure itself (i.e. the Throwable), not the message which caused the problem, because that would invite you to entangle the logic of parent and child beyond what is healthy.