Created
September 26, 2012 18:47
-
-
Save rkuhn/3789797 to your computer and use it in GitHub Desktop.
actor dsl demo
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
import akka.actor.ActorDSL._ | |
val ref = actor("fred")(new Act { | |
become { | |
case "hello" => sender ! "world!" | |
} | |
}) | |
implicit val recv = inbox() | |
ref ! "hello" // uses the `recv` as sender ref | |
recv.select() { case "world!" => println("got it") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment