Removing Future.as[] and commenting out 2 Java Specs because the compiler can't find them?

This commit is contained in:
Viktor Klang 2011-12-11 20:12:55 +01:00
parent 4f925007ea
commit 2673a9c047
36 changed files with 125 additions and 134 deletions

View file

@ -3,6 +3,8 @@ package akka.docs.actor
//#imports1
import akka.actor.Actor
import akka.event.Logging
import akka.dispatch.Future
//#imports1
//#imports2
@ -186,11 +188,9 @@ class ActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
val myActor = system.actorOf(new MyActor)
implicit val timeout = system.settings.ActorTimeout
val future = myActor ? "hello"
future.as[String] match {
case Some(answer) //...
case None //...
}
val result: Option[Int] = for (x (myActor ? 3).as[Int]) yield { 2 * x }
for (x future) println(x) //Prints "hello"
val result: Future[Int] = for (x (myActor ? 3).mapTo[Int]) yield { 2 * x }
//#using-ask
myActor.stop()