【发布时间】:2017-09-02 05:39:57
【问题描述】:
我正在执行磁盘密集型操作,我想使用我自己的线程池而不是默认线程池。
我阅读了以下链接,我遇到了完全相同的问题 Akka :: dispatcher [%name%] not configured, using default-dispatcher
但我的配置文件略有不同,我已经尝试过这个建议但它不起作用。
我在游戏中的application.conf 有以下内容
jpa-execution-context {
thread-pool-executor {
core-pool-size-factor = 10.0
core-pool-size-max = 10
}
}
然后在我的测试代码中执行以下操作,但出现异常。这是测试方法
private def testContext():Future[Int] = {
val system = ActorSystem.create()
val a = ActorSystem.create()
implicit val executionContext1 = system.dispatchers.lookup("jpa-execution-context")
Future{logger.error("inside my new thread pool wonderland");10}{executionContext1}
}
这是一个例外:
akka.ConfigurationException: Dispatcher [jpa-execution-context] not configured
【问题讨论】:
标签: scala playframework akka