【发布时间】:2013-10-17 09:07:18
【问题描述】:
我从这里收到上述错误消息:
implicit val askTimeout = Timeout(60 seconds)
val workerFuture = workerContext actorSelection(payload.classname) resolveOne()
val worker = Await.result(workerFuture, 10 seconds)
worker ask Landau(List("1", "2", "3"))
特别是从第二行.. 所做的导入是
import akka.actor._
import akka.util.Timeout
import akka.pattern.{ ask, pipe }
import scala.concurrent.duration._
import scala.concurrent.Await
import java.util.concurrent.TimeUnit
akka 版本是 2.2.1,scala 是 2.10.2,我使用 sbt 0.13 来构建它。 我真的不明白出了什么问题,因为 resolveOne 肯定来自那个包..
编辑:我用
打印了类的所有方法ActorSelection.getClass.getMethods.map(_.getName).foreach { p => println(p)}
结果如下:
apply
toScala
wait
wait
wait
equals
toString
hashCode
getClass
notify
notifyAll
【问题讨论】:
-
resolveOne是在 akka 2.2.1 版中添加的。确保您使用的不是 2.2.0 版 -
在 sbt 中,我正在使用 scala-action v2.2.1 构建 ..
-
您正在打印 ActorSelection 伴生对象的方法,ActorSelection 类一直有一个
tell方法。