T
- the type of the operation resultpublic interface Operation<T>
extends java.util.concurrent.Future<T>, java.util.concurrent.CompletionStage<T>
CompletionStage
methods.Modifier and Type | Method and Description |
---|---|
default Operation<java.lang.Void> |
acceptEither(java.util.concurrent.CompletionStage<? extends T> other,
java.util.function.Consumer<? super T> action) |
default Operation<java.lang.Void> |
acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T> other,
java.util.function.Consumer<? super T> action) |
default Operation<java.lang.Void> |
acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T> other,
java.util.function.Consumer<? super T> action,
java.util.concurrent.Executor executor) |
default <U> Operation<U> |
applyToEither(java.util.concurrent.CompletionStage<? extends T> other,
java.util.function.Function<? super T,U> fn) |
default <U> Operation<U> |
applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T> other,
java.util.function.Function<? super T,U> fn) |
default <U> Operation<U> |
applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T> other,
java.util.function.Function<? super T,U> fn,
java.util.concurrent.Executor executor) |
default Operation<T> |
exceptionally(java.util.function.Function<java.lang.Throwable,? extends T> fn) |
default java.util.concurrent.Executor |
executor()
Returns the default asynchronous execution pool for this operation.
|
default <U> Operation<U> |
handle(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn) |
default <U> Operation<U> |
handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn) |
default <U> Operation<U> |
handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn,
java.util.concurrent.Executor executor) |
<U> Operation<U> |
map(java.util.function.Function<? super T,? extends U> fn)
Returns a new Operation that represents the synchronous mapping of this stages result using the provided
function.
|
static <T> Operation<T> |
operation(java.util.concurrent.CompletableFuture<T> future)
Create an operation who's completion is tied to the given
CompletableFuture . |
static <T> Operation<T> |
operation(java.util.concurrent.CompletableFuture<T> future,
java.util.concurrent.Executor executor)
/**
Create an operation who's completion is tied to the given
CompletableFuture . |
static <T> Operation<T> |
operation(java.util.concurrent.Future<T> future)
Create an operation who's completion is tied to the given
Future . |
static <T> Operation<T> |
operation(java.util.concurrent.Future<T> future,
java.util.concurrent.Executor executor)
Create an operation who's completion is tied to the given
Future . |
default Operation<java.lang.Void> |
runAfterBoth(java.util.concurrent.CompletionStage<?> other,
java.lang.Runnable action) |
default Operation<java.lang.Void> |
runAfterBothAsync(java.util.concurrent.CompletionStage<?> other,
java.lang.Runnable action) |
default Operation<java.lang.Void> |
runAfterBothAsync(java.util.concurrent.CompletionStage<?> other,
java.lang.Runnable action,
java.util.concurrent.Executor executor) |
default Operation<java.lang.Void> |
runAfterEither(java.util.concurrent.CompletionStage<?> other,
java.lang.Runnable action) |
default Operation<java.lang.Void> |
runAfterEitherAsync(java.util.concurrent.CompletionStage<?> other,
java.lang.Runnable action) |
default Operation<java.lang.Void> |
runAfterEitherAsync(java.util.concurrent.CompletionStage<?> other,
java.lang.Runnable action,
java.util.concurrent.Executor executor) |
default Operation<java.lang.Void> |
thenAccept(java.util.function.Consumer<? super T> action) |
default Operation<java.lang.Void> |
thenAcceptAsync(java.util.function.Consumer<? super T> action) |
default Operation<java.lang.Void> |
thenAcceptAsync(java.util.function.Consumer<? super T> action,
java.util.concurrent.Executor executor) |
default <U> Operation<java.lang.Void> |
thenAcceptBoth(java.util.concurrent.CompletionStage<? extends U> other,
java.util.function.BiConsumer<? super T,? super U> action) |
default <U> Operation<java.lang.Void> |
thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U> other,
java.util.function.BiConsumer<? super T,? super U> action) |
default <U> Operation<java.lang.Void> |
thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U> other,
java.util.function.BiConsumer<? super T,? super U> action,
java.util.concurrent.Executor executor) |
default <U> Operation<U> |
thenApply(java.util.function.Function<? super T,? extends U> fn) |
default <U> Operation<U> |
thenApplyAsync(java.util.function.Function<? super T,? extends U> fn) |
default <U> Operation<U> |
thenApplyAsync(java.util.function.Function<? super T,? extends U> fn,
java.util.concurrent.Executor executor) |
default <U,V> Operation<V> |
thenCombine(java.util.concurrent.CompletionStage<? extends U> other,
java.util.function.BiFunction<? super T,? super U,? extends V> fn) |
default <U,V> Operation<V> |
thenCombineAsync(java.util.concurrent.CompletionStage<? extends U> other,
java.util.function.BiFunction<? super T,? super U,? extends V> fn) |
default <U,V> Operation<V> |
thenCombineAsync(java.util.concurrent.CompletionStage<? extends U> other,
java.util.function.BiFunction<? super T,? super U,? extends V> fn,
java.util.concurrent.Executor executor) |
default <U> Operation<U> |
thenCompose(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn) |
default <U> Operation<U> |
thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn) |
default <U> Operation<U> |
thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn,
java.util.concurrent.Executor executor) |
default Operation<java.lang.Void> |
thenRun(java.lang.Runnable action) |
default Operation<java.lang.Void> |
thenRunAsync(java.lang.Runnable action) |
default Operation<java.lang.Void> |
thenRunAsync(java.lang.Runnable action,
java.util.concurrent.Executor executor) |
default java.util.concurrent.CompletableFuture<T> |
toCompletableFuture() |
java.util.concurrent.CompletableFuture<T> |
toCompletableFuture(java.util.concurrent.Executor executor)
Returns a
CompletableFuture maintaining the same completion properties as this stage using the
supplied executor for any necessary synchronous calls. |
default Operation<T> |
usingExecutor(java.util.concurrent.Executor executor)
Returns a new Operation that uses the supplied executor as it's default async executor.
|
default Operation<T> |
whenComplete(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action) |
default Operation<T> |
whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action) |
default Operation<T> |
whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action,
java.util.concurrent.Executor executor) |
default <U> Operation<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn, java.util.concurrent.Executor executor)
handleAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn)
handleAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> handle(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn)
handle
in interface java.util.concurrent.CompletionStage<T>
default Operation<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action, java.util.concurrent.Executor executor)
whenCompleteAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action)
whenCompleteAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<T> whenComplete(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action)
whenComplete
in interface java.util.concurrent.CompletionStage<T>
default Operation<T> exceptionally(java.util.function.Function<java.lang.Throwable,? extends T> fn)
exceptionally
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn, java.util.concurrent.Executor executor)
thenComposeAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn)
thenComposeAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> thenCompose(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn)
thenCompose
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)
runAfterEitherAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
runAfterEitherAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> runAfterEither(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
runAfterEither
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)
acceptEitherAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)
acceptEitherAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> acceptEither(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)
acceptEither
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn, java.util.concurrent.Executor executor)
applyToEitherAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn)
applyToEitherAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> applyToEither(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn)
applyToEither
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)
runAfterBothAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
runAfterBothAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> runAfterBoth(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
runAfterBoth
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,? super U> action, java.util.concurrent.Executor executor)
thenAcceptBothAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,? super U> action)
thenAcceptBothAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<java.lang.Void> thenAcceptBoth(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,? super U> action)
thenAcceptBoth
in interface java.util.concurrent.CompletionStage<T>
default <U,V> Operation<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends V> fn, java.util.concurrent.Executor executor)
thenCombineAsync
in interface java.util.concurrent.CompletionStage<T>
default <U,V> Operation<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends V> fn)
thenCombineAsync
in interface java.util.concurrent.CompletionStage<T>
default <U,V> Operation<V> thenCombine(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends V> fn)
thenCombine
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> thenRunAsync(java.lang.Runnable action, java.util.concurrent.Executor executor)
thenRunAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> thenRunAsync(java.lang.Runnable action)
thenRunAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> thenRun(java.lang.Runnable action)
thenRun
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)
thenAcceptAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T> action)
thenAcceptAsync
in interface java.util.concurrent.CompletionStage<T>
default Operation<java.lang.Void> thenAccept(java.util.function.Consumer<? super T> action)
thenAccept
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> thenApplyAsync(java.util.function.Function<? super T,? extends U> fn, java.util.concurrent.Executor executor)
thenApplyAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> thenApplyAsync(java.util.function.Function<? super T,? extends U> fn)
thenApplyAsync
in interface java.util.concurrent.CompletionStage<T>
default <U> Operation<U> thenApply(java.util.function.Function<? super T,? extends U> fn)
thenApply
in interface java.util.concurrent.CompletionStage<T>
<U> Operation<U> map(java.util.function.Function<? super T,? extends U> fn)
U
- the function's return typefn
- the mapping functiondefault Operation<T> usingExecutor(java.util.concurrent.Executor executor)
executor
- async executordefault java.util.concurrent.Executor executor()
default java.util.concurrent.CompletableFuture<T> toCompletableFuture()
toCompletableFuture
in interface java.util.concurrent.CompletionStage<T>
java.util.concurrent.CompletableFuture<T> toCompletableFuture(java.util.concurrent.Executor executor)
CompletableFuture
maintaining the same completion properties as this stage using the
supplied executor for any necessary synchronous calls.executor
- executor for sync callsstatic <T> Operation<T> operation(java.util.concurrent.CompletableFuture<T> future)
CompletableFuture
.
Default async execution mode operations against the returned operation will use the invoking pool (if there is one)
or the ForkJoinPool.commonPool()
to poll the future when necessary.
T
- the operations result typefuture
- underlying completable futurestatic <T> Operation<T> operation(java.util.concurrent.CompletableFuture<T> future, java.util.concurrent.Executor executor)
CompletableFuture
.
Default async execution mode operations against the returned operation will use the supplied executor.
T
- the operations result typefuture
- underlying completable futureexecutor
- default async executorstatic <T> Operation<T> operation(java.util.concurrent.Future<T> future)
Future
.
Default async execution mode operations against the returned operation will use the invoking pool (if there is one)
or the ForkJoinPool.commonPool()
to poll the future when necessary.
T
- the operations result typefuture
- underlying futurestatic <T> Operation<T> operation(java.util.concurrent.Future<T> future, java.util.concurrent.Executor executor)
Future
.
Default async execution mode operations against the returned operation will use the supplied executor.
T
- the operations result typefuture
- underlying futureexecutor
- default async executor