Skip to content

Instantly share code, notes, and snippets.

@seanparsons
Created January 30, 2011 20:49
Show Gist options
  • Save seanparsons/803235 to your computer and use it in GitHub Desktop.
Save seanparsons/803235 to your computer and use it in GitHub Desktop.
class IntMatchActor extends Actor {
def receive = {
case 1 => self.reply("This is number 1.")
case 2 => self.reply("This is number 2, it comes after 1.")
case _ => self.reply("This value is neither 1 nor 2.")
}
}
val intMatchActor = actorOf[IntMatchActor].start
println(intMatchActor !! 1)
println(intMatchActor !! 99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment