Returns a future that delegates to another but will finish early (via a TimeoutException wrapped in an ExecutionException) if the specified duration expires. The delegate future is interrupted and cancelled if it times out. @param delegate The future to delegate to. @param time
(
ListenableFuture<V> delegate,
long time,
TimeUnit unit,
ScheduledExecutorService scheduledExecutor)
| 455 | */ |
| 456 | |
| 457 | @GwtIncompatible // java.util.concurrent.ScheduledExecutorService |
| 458 | public static <V> ListenableFuture<V> withTimeout( |
| 459 | ListenableFuture<V> delegate, |
| 460 | long time, |
| 461 | TimeUnit unit, |
| 462 | ScheduledExecutorService scheduledExecutor) { |
| 463 | return TimeoutFuture.create(delegate, time, unit, scheduledExecutor); |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * Returns a new {@code Future} whose result is asynchronously derived from the result of the |