Scala - ScheduledFuture
Estoy tratando de implementar el futuro programado en Scala. Me gustaría esperar un tiempo específico y luego ejecutar el cuerpo. Hasta ahora he intentado el siguiente, sencillo enfoque.
val d = 5.seconds.fromNow
val f = future {Await.ready(Promise().future, d.timeLeft); 1}
val res = Await.result(f, Duration.Inf)
Pero estoy obteniendo el TimeoutExcpetion sobre el futuro. ¿Es este incluso el enfoque correcto o simplemente debo usar el ScheduledExecutor de Java?