[error] DeviceAffiliationCluster.scala:56: value ask is not a member of akka.actor.ActorRef
[error] def ask(msg: Any): Future[Any] = deviceRegion.ask(msg)
[error] ^
[warn] DeviceAffiliationCluster.scala:5: Unused import
[warn] import akka.pattern.ask
akka.pattern.ask
提供隐式转化(从ActorRef
到AskableActorRef
,后者提供方法ask
)
但是,当我使用sbt进行编译时,无法识别转换。 (Intellij看到隐式转换并且没有问题,但我使用sbt来构建。)
我可以让它明确地运作:
val deviceRegion: ActorRef = ...
val deviceRegionAskable: AskableActorRef = deviceRegion