akkaakka-actor

Akka classic: how do I spawn a child actor from an AbstractActor?


I'm reading Akka's documentation for typed actors, which describes how to spawn child actors.

However, I don't find a way to achieve the same using a classic AbstractActor.

I am confused about whether it is even possible.


Solution

  • The current Akka documentation refers to actors based on AbstractActor as "classic" actors.

    Here's the documentation for classic actors: https://doc.akka.io/docs/akka/current/index-classic.html

    What you're looking for is here: https://doc.akka.io/docs/akka/current/actors.html#creating-actors-with-props

    Using the ActorSystem will create top-level actors, supervised by the actor system’s provided guardian actor while using an actor’s context will create a child actor.