Advertisement
Guest User

Main.scala

a guest
Jun 19th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.52 KB | None | 0 0
  1. //Main.scala in src/main/scala
  2. import akka.actor.Actor
  3. import akka.actor.ActorSystem
  4. import akka.actor.Props
  5. import akka.actor.actorRef2Scala
  6.  
  7. object Main extends App {
  8.     val system = ActorSystem("System")
  9.     val a = system.actorOf(Props[TestActor].withDispatcher("akka.actor.my-pinned-dispatcher"))
  10.     //val a = system.actorOf(Props[TestActor].withDispatcher("akka.actor.my-dispatcher"))
  11.    
  12.     a ! "Hello World"
  13.    
  14.     system.shutdown()
  15. }
  16.  
  17. class TestActor extends Actor {
  18.     def receive = {
  19.         case s: String => println(s)
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement