Removing Future.as[] and commenting out 2 Java Specs because the compiler can't find them?
This commit is contained in:
parent
4f925007ea
commit
2673a9c047
36 changed files with 125 additions and 134 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue