/** * Create a Promise which, after a delay, will be redeemed with the result of a * given function. The function will be called after the delay. * * @param function The function to call to fulfill the Promise. * @param delay The time to wait. * @param unit The units to use for the delay. * Use {@link Futures#delayed(Supplier, long, TimeUnit, Executor)} instead. */ public static <A> Promise<A> delayed(Supplier<A> function, long delay, TimeUnit unit, Executor ec) { return wrap(Futures.delayed(function, delay, unit, (ec))); }
/** * Create a Promise which, after a delay, will be redeemed with the result of a * given function. The function will be called after the delay. * <p> * The function will be run in the default ExecutionContext. * * @param function The function to call to fulfill the Promise. * @param delay The time to wait. * @param unit The units to use for the delay. * Use {@link Futures#delayed(Supplier, long, TimeUnit, Executor)} with * {@link Execution#httpPromiseContext()} instead. */ public static <A> Promise<A> delayed(Supplier<A> function, long delay, TimeUnit unit) { return wrap(Futures.delayed(function, delay, unit, Execution.httpPromiseContext())); }