Created
December 20, 2013 07:24
-
-
Save longcao/8051493 to your computer and use it in GitHub Desktop.
Server source code.
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
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