class TimeoutCompletableFuture<T>
extends java.util.concurrent.CompletableFuture<T>
orTimeout
to Java 8 with a custom implementation. On Java 9+
the built-in method is called.Modifier and Type | Class and Description |
---|---|
private static class |
TimeoutCompletableFuture.TimeoutScheduler |
Modifier and Type | Field and Description |
---|---|
private static java.lang.reflect.Method |
orTimeoutMethod |
Constructor and Description |
---|
TimeoutCompletableFuture() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.concurrent.CompletableFuture<T> |
compatTimeout(java.util.concurrent.CompletableFuture<T> f,
long timeout,
java.util.concurrent.TimeUnit unit) |
java.util.concurrent.CompletableFuture<T> |
compatTimeout(long timeout,
java.util.concurrent.TimeUnit unit) |
private static <T> java.util.concurrent.CompletableFuture<T> |
orTimeout(java.util.concurrent.CompletableFuture<T> f,
long timeout,
java.util.concurrent.TimeUnit unit) |
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completedFuture, completeExceptionally, exceptionally, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, obtrudeException, obtrudeValue, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
public java.util.concurrent.CompletableFuture<T> compatTimeout(long timeout, java.util.concurrent.TimeUnit unit)
public static <T> java.util.concurrent.CompletableFuture<T> compatTimeout(java.util.concurrent.CompletableFuture<T> f, long timeout, java.util.concurrent.TimeUnit unit)
private static <T> java.util.concurrent.CompletableFuture<T> orTimeout(java.util.concurrent.CompletableFuture<T> f, long timeout, java.util.concurrent.TimeUnit unit)