Skip to content

Instantly share code, notes, and snippets.

@bhameyie
Created February 6, 2015 01:47
Show Gist options
  • Save bhameyie/a4a022b3c070ec22f7d4 to your computer and use it in GitHub Desktop.
Save bhameyie/a4a022b3c070ec22f7d4 to your computer and use it in GitHub Desktop.
Vanilla Akka usage
object Main {
def main(args: Array[String]): Unit = {
val systemName = "47Ronin"
val system = ActorSystem(systemName)
val printer = system.actorOf(Props[PrinterDude], "printerDude")
printer ! PrintIt("Hello World!")
}
}
case class PrintIt(msg:String)
class PrinterDude extends Actor {
def receive = {
case PrintIt(msg) =>
Console.println(msg)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment