0
私はPlay 2.3.7を使用していますので、コントローラ内部からアクタを使用する必要があります。次のコードは、カスタムディスパッチャを検索できません
implicit val system = ActorSystem()
implicit val dispatcher = system.dispatcher
val future = (IO(Http) ? Get(url).withHeaders(...).mapTo[HttpResponse]
val result = Await.results(future, Duration.Inf)
を正常に動作している今、私は私のconf/application.conf
play {
akka {
actor {
default-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
fixed-pool-size = 128
}
}
foo-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
fixed-pool-size = 128
}
}
}
}
}
に以下の変更を行いそして今、私はメッセージで例外を取得
implicit val system = ActorSystem()
implicit val dispatcher = system.dispatchers.lookup("foo-dispatcher")
val future = (IO(Http) ? Get(url).withHeaders(...).mapTo[HttpResponse]
val result = Await.results(future, Duration.Inf)
に私のコードを変更[foo-dispatcher] not configured