Created
February 6, 2015 01:47
-
-
Save bhameyie/a4a022b3c070ec22f7d4 to your computer and use it in GitHub Desktop.
Vanilla Akka usage
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
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!") | |
} | |
} |
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
case class PrintIt(msg:String) |
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 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