Describes a dependency relationship between actors, the parent and child releationship. Parent is unique because it has created the child actor, so the parent is responsible for reacting when failures happens in his child.
And parent decides which choice needs to be selected. When a parent receives the failure signal from it’s child then depending on the nature of failure, the parent decides from following options:
Resume: Parent starts the child actor keeping its internal state.
Restart: Parent starts the child actor by clearing it’s internal state.
Stop: Stop the child permanently.
Escalate: Escalate the failure by failing itself and propagate failure to its parent.
Akka Life Cycle
It is always important to view a part of supervision hierarchy, which explains the escalate option. Each supervisor should cover with all possible failure cases.
Actor System: Source: doc.akka.io
/user: The User Guardian Actor
Actor created using system.actorOf() are children of user guardian actor. Whenever user guardian terminates, all user created actors will be terminated too. Top level user created actors are determined by user guardian actor that how they will be supervised. Root Guardian is the supervisor of user guardian.
/root: The Root Guardian
The root guardian actor is the father of all actor system. It supervises user guardian actor and system guardian actor.