Actor supervision

Now, let's explain another strangeness in the actor path that you are probably wondering about—the leading /user part in the actors paths we've seen before. The existence of this part is Akka's answer to the question we stated at the beginning of this chapter—How is the very first actor created?

In Akka, the very first actor is created by the library itself. It represents a root actor and is called the root guardian accordingly (we'll explain the guardian part in a moment).

In fact, Akka creates three guardian actors for each actor system, as shown in the following diagram.

The / root guardian is a parent for two other guardians and thus an ancestor of any other actor in the system.

The /user guardian is a root actor for ...

Get Learn Scala Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.