Created
January 31, 2013 20:23
-
-
Save ianmcmahon/4686111 to your computer and use it in GitHub Desktop.
using scalaj.http.Http makes message sending break
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
import akka.actor.{ActorSystem, Props, Actor} | |
import scalaj.http.Http | |
case object Start | |
class Master extends Actor { | |
val worker = context.actorOf(Props[Worker], name = "worker") | |
def receive = { | |
case Start => | |
worker ! Start | |
case s:String => println(s) | |
case _ => | |
println("default") | |
} | |
} | |
class Worker extends Actor { | |
def receive = { | |
case Start => | |
// val data = Http("http://google.com/").asString | |
sender ! "foo" | |
} | |
} | |
object TestApp extends App { | |
val system = ActorSystem("TestApp") | |
val master = system.actorOf(Props[Master], "master") | |
master ! Start | |
system.shutdown() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment