I have an error of importing Await from akka.io. Here is my build.sbt:
name := "Project1"
version := "0.1"
scalaVersion := "2.10.1"
libraryDependencies += "org.json4s" %% "json4s-native" % "3.2.4"
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
libraryDependencies += "com.typesafe.akka" % "akka-actor_2.10" % "2.1.4"
Here is a part of a code:
import akka.actor.Actor
import akka.actor.ActorSystem
import akka.actor.Props
import akka.dispatch.Await
import akka.pattern.ask
//.......
private def resultId = {
private val someActor = context.actorSelection("../someActor123") // defined in Application object
val future = someActor ? SomeMessage
val result = Await.result(future, 1.timeout).asInstanceOf[String]
}
It says object Await is not a member of package akka.dispatch
and value ? is not a member of akka.actor.ActorSelection
and not found: value Await
Of course, I reloaded it and did gen-idea.
As @S.R.I noted you should use scala.concurrent.Await
instead of akka.dispatch.Await
.
value ? is not a member of akka.actor.ActorSelection
There is no ask
pattern support for ActorSelection
in version 2.1.4
. See this commit. Ask support for ActorSelection
is available only after version 2.2
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With