May 2017
Intermediate to advanced
414 pages
13h
English
import akka.actor.{ActorSystem, Props, Actor}
case object CreateChild case class Greet(msg: String)
class ChildActor extends Actor { def receive = { case Greet(msg) => println(s"My parent[${self.path.parent}] greeted to me [${self.path}] $msg") } }
class ParentActor extends Actor { def receive = { case CreateChild => val child = context.actorOf(Props[ChildActor], "child") child ! Greet("Hello Child") } }
Read now
Unlock full access