Now that we've made the compiler happy and got our first impression about how typed actors tick, let's take a more principled approach and look in detail at how they can be created, discovered, and stopped, and what possibilities there are to change an actor's behavior.
Akka Typed basics
Creating an actor
In accordance to the actor model definition, there is exactly one way that an actor can be created—it can be spawned by another actor. Akka gives you two slightly different possibilities to do this by using ActorContext. Both methods are not thread safe and should only be used directly within the actor's thread.
The first variant allows you to instantiate an anonymous actor from a behavior and returns...