Ich benutze Play 2.3.7 und ich brauche Actors aus dem Controller. Der folgende Code funktioniert gutNicht in der Lage, einen benutzerdefinierten Dispatcher nachzuschlagen
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)
Jetzt habe ich folgende Änderung der Code meiner 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
}
}
}
}
}
Und jetzt machen ändern
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)
Ich erhalte eine Ausnahme mit der Meldung [foo-dispatcher] not configured