Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@longcao
Created December 20, 2013 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save longcao/8051493 to your computer and use it in GitHub Desktop.
Save longcao/8051493 to your computer and use it in GitHub Desktop.
Server source code.
import akka.actor._
object Server extends App {
val system = ActorSystem("serverSystem")
val serverActor = system.actorOf(Props(new ServerActor), name = "ServerActor")
}
class ServerActor extends Actor {
def receive = {
case message: String =>
println("Internal monologue: What? Someone said hello. Nobody taught me any social skills in this basement. I should say hi back.")
sender ! "Hi."
case _ => println("I got something I didn't understand.")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment