Akka players framework - context.actorOf vs system.actorOf

Could you explain to me what is the difference between

context.actorOf

and

system.actorOf

?

+5
source share
1 answer

The answer to this can be easily found in the Akka documentation:

The actor system is usually started by creating actors under the guardian, using the ActorSystem.actorOf method, and then using the ActorContext.actorOf from the created participants to create a player tree.

  • Actors created using System.actorOf will be the children of the guardian actor.
  • Actors created using context.actorOf will be children of the context itself, i.e. the actor calling the method.

As a more general suggestion, make sure you carefully study the Akka docs when looking for similar answers.

+9
source

Source: https://habr.com/ru/post/1261648/


All Articles