Skip to content

Instantly share code, notes, and snippets.

@mumrah
Created August 17, 2012 14:39
Show Gist options
  • Save mumrah/3379274 to your computer and use it in GitHub Desktop.
Save mumrah/3379274 to your computer and use it in GitHub Desktop.
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