无法访问Play!内部参与者系统



我遵循这里的文档,因为我想将actor添加到应用程序提供的actor系统中。我尝试导入应用程序演员系统与:

import play.libs.concurrent.Akka

我正在使用sbt compile调用我的编译并收到以下错误

[error] app/controllers/Application.scala:9: object concurrent is not a member of package play.libs
[error] import play.libs.concurrent.Akka
[error]                  ^
[error] one error found

conf/application.conf

#Disable DBPlugin
dbplugin=disabled
#Disable DB evolutions
evolutionplugin=disabled
#Disable Eh Cache
ehcacheplugin=disabled

# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
# Root logger:
logger.root=ERROR
# Logger used by the framework:
logger.play=INFO
# Logger provided to your application:
logger.application=DEBUG
akka.default-dispatcher.core-pool-size-max = 64
akka.debug.receive = on

项目/Build.scala

import sbt._
import Keys._
import PlayProject._
object ApplicationBuild extends Build {
    val appName         = "SomeCoolApp"
    val appVersion      = "1.0"
    val appDependencies = Seq(
      // Add your project dependencies here,
      "com.typesafe.akka" % "akka-actor" % "2.+"
    )
    val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
      // Add your own project settings here      
    )
}

访问Play!2.0内部演员系统,使用

import play.api.libs.concurrent.Akka.system

请参阅API文档以了解正确的实现。

最新更新