Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
CompletableFuture.acceptEither(CompletionStage<? extends T> other,
java9.util.function.Consumer<? super T> action) |
CompletableFuture<Void> |
CompletableFuture.acceptEitherAsync(CompletionStage<? extends T> other,
java9.util.function.Consumer<? super T> action) |
CompletableFuture<Void> |
CompletableFuture.acceptEitherAsync(CompletionStage<? extends T> other,
java9.util.function.Consumer<? super T> action,
Executor executor) |
static CompletableFuture<Void> |
CompletableFuture.allOf(CompletableFuture<?>... cfs)
Returns a new CompletableFuture that is completed when all of
the given CompletableFutures complete.
|
static CompletableFuture<Object> |
CompletableFuture.anyOf(CompletableFuture<?>... cfs)
Returns a new CompletableFuture that is completed when any of
the given CompletableFutures complete, with the same result.
|
<U> CompletableFuture<U> |
CompletableFuture.applyToEither(CompletionStage<? extends T> other,
java9.util.function.Function<? super T,U> fn) |
<U> CompletableFuture<U> |
CompletableFuture.applyToEitherAsync(CompletionStage<? extends T> other,
java9.util.function.Function<? super T,U> fn) |
<U> CompletableFuture<U> |
CompletableFuture.applyToEitherAsync(CompletionStage<? extends T> other,
java9.util.function.Function<? super T,U> fn,
Executor executor) |
CompletableFuture<T> |
CompletableFuture.completeAsync(java9.util.function.Supplier<? extends T> supplier)
Completes this CompletableFuture with the result of the given
Supplier function invoked from an asynchronous task using the
default executor.
|
CompletableFuture<T> |
CompletableFuture.completeAsync(java9.util.function.Supplier<? extends T> supplier,
Executor executor)
Completes this CompletableFuture with the result of
the given Supplier function invoked from an asynchronous
task using the given executor.
|
static <U> CompletableFuture<U> |
CompletableFuture.completedFuture(U value)
Returns a new CompletableFuture that is already completed with
the given value.
|
CompletableFuture<T> |
CompletableFuture.completeOnTimeout(T value,
long timeout,
TimeUnit unit)
Completes this CompletableFuture with the given value if not
otherwise completed before the given timeout.
|
CompletableFuture<T> |
CompletableFuture.copy()
Returns a new CompletableFuture that is completed normally with
the same value as this CompletableFuture when it completes
normally.
|
CompletableFuture<T> |
CompletableFuture.exceptionally(java9.util.function.Function<Throwable,? extends T> fn) |
CompletableFuture<T> |
CompletableFuture.exceptionallyAsync(java9.util.function.Function<Throwable,? extends T> fn)
Returns a new CompletionStage that, when this stage completes
exceptionally, is executed with this stage's exception as the
argument to the supplied function, using this stage's default
asynchronous execution facility.
|
CompletableFuture<T> |
CompletableFuture.exceptionallyAsync(java9.util.function.Function<Throwable,? extends T> fn,
Executor executor)
Returns a new CompletionStage that, when this stage completes
exceptionally, is executed with this stage's exception as the
argument to the supplied function, using the supplied
Executor.
|
CompletableFuture<T> |
CompletableFuture.exceptionallyCompose(java9.util.function.Function<Throwable,? extends CompletionStage<T>> fn)
Returns a new CompletionStage that, when this stage completes
exceptionally, is composed using the results of the supplied
function applied to this stage's exception.
|
CompletableFuture<T> |
CompletableFuture.exceptionallyComposeAsync(java9.util.function.Function<Throwable,? extends CompletionStage<T>> fn)
Returns a new CompletionStage that, when this stage completes
exceptionally, is composed using the results of the supplied
function applied to this stage's exception, using this
stage's default asynchronous execution facility.
|
CompletableFuture<T> |
CompletableFuture.exceptionallyComposeAsync(java9.util.function.Function<Throwable,? extends CompletionStage<T>> fn,
Executor executor)
Returns a new CompletionStage that, when this stage completes
exceptionally, is composed using the results of the supplied
function applied to this stage's exception, using the
supplied Executor.
|
static <U> CompletableFuture<U> |
CompletableFuture.failedFuture(Throwable ex)
Returns a new CompletableFuture that is already completed
exceptionally with the given exception.
|
<U> CompletableFuture<U> |
CompletableFuture.handle(java9.util.function.BiFunction<? super T,Throwable,? extends U> fn) |
<U> CompletableFuture<U> |
CompletableFuture.handleAsync(java9.util.function.BiFunction<? super T,Throwable,? extends U> fn) |
<U> CompletableFuture<U> |
CompletableFuture.handleAsync(java9.util.function.BiFunction<? super T,Throwable,? extends U> fn,
Executor executor) |
<U> CompletableFuture<U> |
CompletableFuture.newIncompleteFuture()
Returns a new incomplete CompletableFuture of the type to be
returned by a CompletionStage method.
|
CompletableFuture<T> |
CompletableFuture.orTimeout(long timeout,
TimeUnit unit)
Exceptionally completes this CompletableFuture with
a
TimeoutException if not otherwise completed
before the given timeout. |
CompletableFuture<Void> |
CompletableFuture.runAfterBoth(CompletionStage<?> other,
Runnable action) |
CompletableFuture<Void> |
CompletableFuture.runAfterBothAsync(CompletionStage<?> other,
Runnable action) |
CompletableFuture<Void> |
CompletableFuture.runAfterBothAsync(CompletionStage<?> other,
Runnable action,
Executor executor) |
CompletableFuture<Void> |
CompletableFuture.runAfterEither(CompletionStage<?> other,
Runnable action) |
CompletableFuture<Void> |
CompletableFuture.runAfterEitherAsync(CompletionStage<?> other,
Runnable action) |
CompletableFuture<Void> |
CompletableFuture.runAfterEitherAsync(CompletionStage<?> other,
Runnable action,
Executor executor) |
static CompletableFuture<Void> |
CompletableFuture.runAsync(Runnable runnable)
Returns a new CompletableFuture that is asynchronously completed
by a task running in the
ForkJoinPool.commonPool() after
it runs the given action. |
static CompletableFuture<Void> |
CompletableFuture.runAsync(Runnable runnable,
Executor executor)
Returns a new CompletableFuture that is asynchronously completed
by a task running in the given executor after it runs the given
action.
|
static <U> CompletableFuture<U> |
CompletableFuture.supplyAsync(java9.util.function.Supplier<U> supplier)
Returns a new CompletableFuture that is asynchronously completed
by a task running in the
ForkJoinPool.commonPool() with
the value obtained by calling the given Supplier. |
static <U> CompletableFuture<U> |
CompletableFuture.supplyAsync(java9.util.function.Supplier<U> supplier,
Executor executor)
Returns a new CompletableFuture that is asynchronously completed
by a task running in the given executor with the value obtained
by calling the given Supplier.
|
CompletableFuture<Void> |
CompletableFuture.thenAccept(java9.util.function.Consumer<? super T> action) |
CompletableFuture<Void> |
CompletableFuture.thenAcceptAsync(java9.util.function.Consumer<? super T> action) |
CompletableFuture<Void> |
CompletableFuture.thenAcceptAsync(java9.util.function.Consumer<? super T> action,
Executor executor) |
<U> CompletableFuture<Void> |
CompletableFuture.thenAcceptBoth(CompletionStage<? extends U> other,
java9.util.function.BiConsumer<? super T,? super U> action) |
<U> CompletableFuture<Void> |
CompletableFuture.thenAcceptBothAsync(CompletionStage<? extends U> other,
java9.util.function.BiConsumer<? super T,? super U> action) |
<U> CompletableFuture<Void> |
CompletableFuture.thenAcceptBothAsync(CompletionStage<? extends U> other,
java9.util.function.BiConsumer<? super T,? super U> action,
Executor executor) |
<U> CompletableFuture<U> |
CompletableFuture.thenApply(java9.util.function.Function<? super T,? extends U> fn) |
<U> CompletableFuture<U> |
CompletableFuture.thenApplyAsync(java9.util.function.Function<? super T,? extends U> fn) |
<U> CompletableFuture<U> |
CompletableFuture.thenApplyAsync(java9.util.function.Function<? super T,? extends U> fn,
Executor executor) |
<U,V> CompletableFuture<V> |
CompletableFuture.thenCombine(CompletionStage<? extends U> other,
java9.util.function.BiFunction<? super T,? super U,? extends V> fn) |
<U,V> CompletableFuture<V> |
CompletableFuture.thenCombineAsync(CompletionStage<? extends U> other,
java9.util.function.BiFunction<? super T,? super U,? extends V> fn) |
<U,V> CompletableFuture<V> |
CompletableFuture.thenCombineAsync(CompletionStage<? extends U> other,
java9.util.function.BiFunction<? super T,? super U,? extends V> fn,
Executor executor) |
<U> CompletableFuture<U> |
CompletableFuture.thenCompose(java9.util.function.Function<? super T,? extends CompletionStage<U>> fn) |
<U> CompletableFuture<U> |
CompletableFuture.thenComposeAsync(java9.util.function.Function<? super T,? extends CompletionStage<U>> fn) |
<U> CompletableFuture<U> |
CompletableFuture.thenComposeAsync(java9.util.function.Function<? super T,? extends CompletionStage<U>> fn,
Executor executor) |
CompletableFuture<Void> |
CompletableFuture.thenRun(Runnable action) |
CompletableFuture<Void> |
CompletableFuture.thenRunAsync(Runnable action) |
CompletableFuture<Void> |
CompletableFuture.thenRunAsync(Runnable action,
Executor executor) |
CompletableFuture<T> |
CompletableFuture.toCompletableFuture()
Returns this CompletableFuture.
|
CompletableFuture<T> |
CompletionStage.toCompletableFuture()
Returns a
CompletableFuture maintaining the same
completion properties as this stage. |
CompletableFuture<T> |
CompletableFuture.whenComplete(java9.util.function.BiConsumer<? super T,? super Throwable> action) |
CompletableFuture<T> |
CompletableFuture.whenCompleteAsync(java9.util.function.BiConsumer<? super T,? super Throwable> action) |
CompletableFuture<T> |
CompletableFuture.whenCompleteAsync(java9.util.function.BiConsumer<? super T,? super Throwable> action,
Executor executor) |
Modifier and Type | Method and Description |
---|---|
static <T> java9.util.stream.Stream<CompletableFuture<T>> |
CompletableFuture.completed(Collection<? extends CompletableFuture<T>> cfs)
Returns a stream that is lazily populated with the given CompletableFutures
when they complete.
|
static <T> java9.util.stream.Stream<CompletableFuture<T>> |
CompletableFuture.completed(CompletableFuture<T>... cfs)
Returns a stream that is lazily populated with the given CompletableFutures
when they complete.
|
Modifier and Type | Method and Description |
---|---|
static CompletableFuture<Void> |
CompletableFuture.allOf(CompletableFuture<?>... cfs)
Returns a new CompletableFuture that is completed when all of
the given CompletableFutures complete.
|
static CompletableFuture<Object> |
CompletableFuture.anyOf(CompletableFuture<?>... cfs)
Returns a new CompletableFuture that is completed when any of
the given CompletableFutures complete, with the same result.
|
static <T> java9.util.stream.Stream<CompletableFuture<T>> |
CompletableFuture.completed(CompletableFuture<T>... cfs)
Returns a stream that is lazily populated with the given CompletableFutures
when they complete.
|
Modifier and Type | Method and Description |
---|---|
static <T> java9.util.stream.Stream<CompletableFuture<T>> |
CompletableFuture.completed(Collection<? extends CompletableFuture<T>> cfs)
Returns a stream that is lazily populated with the given CompletableFutures
when they complete.
|
Copyright © 2021. All rights reserved.