我想从下面的代码中删除超时定义,因此它不会在定义的时间段内超时。我怎样才能做到这一点?
val futureString: Future[String] = myTestActor.ask(Message).mapTo[String]
val timeoutFuture: Future[String] = play.api.libs.concurrent.Promise.timeout(throw new TimeoutException(), 5 seconds)
Async {
Future.firstCompletedOf(Seq(futureString, timeoutFuture)) map {
case result: String => println("got message " + result)
} recover {
case _: TimeoutException => "Timed out?"
}
}