Created
January 11, 2012 13:00
-
-
Save freekh/1594549 to your computer and use it in GitHub Desktop.
First Akka actor
This file contains hidden or 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
//your first actor | |
class MyActor extends akka.actor.Actor { | |
def receive = { //when a message is received... | |
case m =>println(m.toString) //...print it out | |
} | |
} | |
val actorRef = akka.actor.Actor.actorOf[MyActor].start() //start the actor | |
actorRef ! "Congratulations from your first Akka actor" //send a message | |
actorRef ! akka.actor.PoisonPill //the actor will stop when this message is received |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment