Created
February 5, 2014 22:25
-
-
Save chbatey/8834575 to your computer and use it in GitHub Desktop.
Akka: Example parent sending message to child
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ParentActor extends Actor { | |
def receive: Actor.Receive = { | |
case msg @ _ => { | |
println(s"Received msg, delegating work to a child actor") | |
val childActor = context.actorOf(Props[ChildActor]) | |
childActor ! "Go and do something important!" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment