Is there a way to delay the execution (not the completion) of a future,
similar to the scheduleOnce method for actors? I tried this:
Future<String> delayedString = Patterns.after(new FiniteDuration(10,
TimeUnit.SECONDS),
system.scheduler(), system.dispatcher(), Futures.future(new
Callable<String>() {
public String call() throws Exception {
System.out.println("Returning some string immediately");
return "Some string.";
}
}, system.dispatcher()));
System.out.println("delayedString=" + Await.result(delayedString,
Duration.Inf()));
But this calls the Callable immediately and only waits 10 seconds for the
result to be returned.
Thanks, John
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.