/** * Create a Promise that is redeemed after a timeout. * * @param message The message to use to redeem the Promise. * @param delay The delay (expressed with the corresponding unit). * @param unit The Unit. * Use {@link Futures#timeout(Object, long, TimeUnit)} instead. */ public static <A> Promise<A> timeout(A message, long delay, TimeUnit unit) { return (Promise<A>) Futures.timeout(message, delay, unit); }
/** * Create a Promise that is redeemed after a timeout. * * @param message The message to use to redeem the Promise. * @param delay The delay expressed in milliseconds. * Use {@link Futures#timeout(Object, long, TimeUnit)} instead. */ public static <A> Promise<A> timeout(A message, long delay) { return wrap(Futures.timeout(message, delay, TimeUnit.MILLISECONDS)); }
/** * Create a Promise timer that throws a PromiseTimeoutException after * a given timeout. * <p> * The returned Promise is usually combined with other Promises. * * @param delay The delay expressed in milliseconds. * Use {@link Futures#timeout(long, TimeUnit)} instead. * @return a promise without a real value */ public static Promise<Void> timeout(long delay) { return wrap(Futures.timeout(delay, TimeUnit.MILLISECONDS)); }
/** * Create a Promise timer that throws a PromiseTimeoutException after * a given timeout. * <p> * The returned Promise is usually combined with other Promises. * * @param delay The delay (expressed with the corresponding unit). * @param unit The Unit. * @return a promise without a real value * Use {@link Futures#timeout(long, TimeUnit)} instead. */ public static Promise<Void> timeout(long delay, TimeUnit unit) { return wrap(Futures.timeout(delay, unit)); }