There are three special actors known as guardians, which are internal to Akka.
1. The one most often seen reference to is the user guardian. The user guardian is handles is responsible for handling any errors that percolate up through the actor hierarchy and which are not handled by any explicit supervisors lower in the tree.
2. The system guardian is responsible for certain system-level services that need to be available before any user-level actors are started and that need to still be running after any user-level actors are shutdown. One instance of this would be the logging actors that reside under the system guardian. The startup order is root, followed by the system, followed by user. The inverse is used for shutdown.
3. The root guardian resides at the very top of the actor hierarchy. Its primary purpose is to handle faults that escalate from the user or system guardians and a few other special root-level actors, with the default action being to stop those children. This guardian, being an actor, still needs a supervisor and it has one: a special pseudo-actor that will stop the child (root guardian) on any failure that reaches this level.
No comments:
Post a Comment