On Page 111, in the object Avionics, val control = Await.result( (plane ? Plane.GiveMeControl).mapTo[ActorRef],5.seconds)
does not compile with error : value ? is not a member of akka.actor.ActorRef
Instead of the above, the following compiles : val future = Patterns.ask(plane, Plane.GiveMeControl, timeout); val control = Await.result(future, timeout.duration).asInstanceOf[ActorRef]
May I know which version of Scala and Akka are used in the book.
At the time of writing, it was Scala 2.10.0-M7 and Akka 2.1-M2. When everything finally solidifies, I'll be switching it to 2.10.0 and 2.1 proper. You should be able to use 2.10.0-RC1 and 2.1-RC1 and have no issues.
But, I think you're just missing the pattern import.
import akka.pattern.ask
and you should get the '?' method added on to the ActorRef.