I’m trying to call a actor to do something time consuming.
The caller set a timer with 5 sec. But I can’t handle the timeout exception with try/catch.
return async(Akka.asPromise(ask(myActor, "hello", uploadImageTimeout)).map(new Function<Object, Result>() {
@Override
public Result apply(Object response) {
return ok("Done");
}
}));
One thing you can do is to “recover” from the exception right inside the Akka future: