MCPcopy Create free account
hub / github.com/antlr/codebuff / withTimeout

Method withTimeout

output/java_guava/1.4.19/Futures.java:457–464  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

createMethod · 0.95

Tested by

no test coverage detected