ps://github.com/yangbajing/akka-cookbook/tree/master/cookbook-actor/src/main/scala/cookbook/actor/introduction/HelloWorld.scala#L23-L50" target="_blank" title="Go to snippet source"></a><code class="language-scala">object Ping {
  sealed trait Command
  final case object Start extends Command
  final case class PongCommand(message: String) extends Command
  def apply(): Behavior[Command] = Behaviors.receive {
    case (context, Start) =&gt;
      val pong = context.spawn(Pong(), &quot;pong&quot;)
      pong