Created
August 17, 2012 14:39
-
-
Save mumrah/3379274 to your computer and use it in GitHub Desktop.
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 PongActor extends Actor { | |
def act() { | |
val y = 4 | |
loop { | |
react { | |
case Ping(2) => | |
println("got ping(2)") | |
sender ! Pong | |
case Ping(y) => | |
println("got ping(y)") | |
sender ! Pong | |
case Ping(x) => | |
println("got ping: " + x) | |
sender ! Pong | |
case Stop => | |
println("got stop") | |
exit() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment