Created
August 21, 2012 19:21
-
-
Save sstone/3418490 to your computer and use it in GitHub Desktop.
calculator actor
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
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