Hi!
I currently use something like
AsyncResult {
(extractor ? Extract(uri)).asPromise.map { result =>
Ok(result.toString)
}
}
to do some work initiated from an Action. As with all ask requests to an Akka Actor it can time out. How can I handle those timeouts gracefully in play?
I couldn't find a way to catch the timeout somehow. I tried a pattern match in the map call, looking for a "null" value (Because I get akka.pattern.AskTimeoutException: null in the logs if I run into a timeout) and wrapping the map in a try catch - neither did work.
Promises seem to have a timeout mechanism on their own, but .asPromise does not magically map the Akka timeout to the promise timeout mechanism, does it?
Hope someone can bring me back on track!
Malax