Skip to content

Instantly share code, notes, and snippets.

@sstone
Created August 21, 2012 19:21
Show Gist options
  • Save sstone/3418490 to your computer and use it in GitHub Desktop.
Save sstone/3418490 to your computer and use it in GitHub Desktop.
calculator actor
case class AddRequest(x:Int, y:Int)
case class AddResponse(sum:Int)
class Calculator extends Actor {
protected def receive = {
case AddRequest(a, b) => sender ! AddResponse(a + b)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment