/** * 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. */ public static <A> Promise<A> timeout(A message, long delay) { return timeout(message, delay, TimeUnit.MILLISECONDS); }
/** * Create a Promise timer that throws a PromiseTimeoutException after * a given timeout. * * The returned Promise is usually combined with other Promises. * * @return a promise without a real value * @param delay The delay expressed in milliseconds. */ public static <A> Promise<scala.Unit> timeout(long delay) { return timeout(delay, TimeUnit.MILLISECONDS); }