Class AbstractAsyncFuture<T>
- java.lang.Object
-
- com.linkedin.alpini.base.concurrency.impl.AbstractAsyncFuture<T>
-
- All Implemented Interfaces:
AsyncFuture<T>
,java.util.concurrent.CompletionStage<T>
,java.util.concurrent.Future<T>
- Direct Known Subclasses:
FailedAsyncFuture
,SuccessAsyncFuture
public abstract class AbstractAsyncFuture<T> extends java.lang.Object implements AsyncFuture<T>
Created by acurtis on 5/1/18.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.linkedin.alpini.base.concurrency.AsyncFuture
AsyncFuture.Status
-
-
Field Summary
-
Fields inherited from interface com.linkedin.alpini.base.concurrency.AsyncFuture
NULL_SUCCESS
-
-
Constructor Summary
Constructors Constructor Description AbstractAsyncFuture()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<java.lang.Void>
acceptEither(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)
java.util.concurrent.CompletionStage<java.lang.Void>
acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)
java.util.concurrent.CompletionStage<java.lang.Void>
acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)
<U> java.util.concurrent.CompletionStage<U>
applyToEither(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn)
<U> java.util.concurrent.CompletionStage<U>
applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn)
<U> java.util.concurrent.CompletionStage<U>
applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn, java.util.concurrent.Executor executor)
java.util.concurrent.CompletionStage<T>
exceptionally(java.util.function.Function<java.lang.Throwable,? extends T> fn)
<U> java.util.concurrent.CompletionStage<U>
handle(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn)
<U> java.util.concurrent.CompletionStage<U>
handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn)
<U> java.util.concurrent.CompletionStage<U>
handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn, java.util.concurrent.Executor executor)
java.util.concurrent.CompletionStage<java.lang.Void>
runAfterBoth(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
java.util.concurrent.CompletionStage<java.lang.Void>
runAfterBothAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
java.util.concurrent.CompletionStage<java.lang.Void>
runAfterBothAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)
java.util.concurrent.CompletionStage<java.lang.Void>
runAfterEither(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
java.util.concurrent.CompletionStage<java.lang.Void>
runAfterEitherAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
java.util.concurrent.CompletionStage<java.lang.Void>
runAfterEitherAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)
java.util.concurrent.CompletionStage<java.lang.Void>
thenAccept(java.util.function.Consumer<? super T> action)
java.util.concurrent.CompletionStage<java.lang.Void>
thenAcceptAsync(java.util.function.Consumer<? super T> action)
java.util.concurrent.CompletionStage<java.lang.Void>
thenAcceptAsync(java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)
<U> java.util.concurrent.CompletionStage<java.lang.Void>
thenAcceptBoth(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,? super U> action)
<U> java.util.concurrent.CompletionStage<java.lang.Void>
thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,? super U> action)
<U> java.util.concurrent.CompletionStage<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)
<U> java.util.concurrent.CompletionStage<U>
thenApply(java.util.function.Function<? super T,? extends U> fn)
<U> java.util.concurrent.CompletionStage<U>
thenApplyAsync(java.util.function.Function<? super T,? extends U> fn)
<U> java.util.concurrent.CompletionStage<U>
thenApplyAsync(java.util.function.Function<? super T,? extends U> fn, java.util.concurrent.Executor executor)
<U,V>
java.util.concurrent.CompletionStage<V>thenCombine(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends V> fn)
<U,V>
java.util.concurrent.CompletionStage<V>thenCombineAsync(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends V> fn)
<U,V>
java.util.concurrent.CompletionStage<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)
<U> java.util.concurrent.CompletionStage<U>
thenCompose(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn)
<U> java.util.concurrent.CompletionStage<U>
thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn)
<U> java.util.concurrent.CompletionStage<U>
thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn, java.util.concurrent.Executor executor)
java.util.concurrent.CompletionStage<java.lang.Void>
thenRun(java.lang.Runnable action)
java.util.concurrent.CompletionStage<java.lang.Void>
thenRunAsync(java.lang.Runnable action)
java.util.concurrent.CompletionStage<java.lang.Void>
thenRunAsync(java.lang.Runnable action, java.util.concurrent.Executor executor)
java.util.concurrent.CompletionStage<T>
whenComplete(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action)
java.util.concurrent.CompletionStage<T>
whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action)
java.util.concurrent.CompletionStage<T>
whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action, java.util.concurrent.Executor executor)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.linkedin.alpini.base.concurrency.AsyncFuture
addListener, addListener, await, await, awaitUninterruptibly, awaitUninterruptibly, getCause, getNow, isSuccess
-
-
-
-
Method Detail
-
thenApply
public <U> java.util.concurrent.CompletionStage<U> thenApply(java.util.function.Function<? super T,? extends U> fn)
- Specified by:
thenApply
in interfacejava.util.concurrent.CompletionStage<T>
-
thenApplyAsync
public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync(java.util.function.Function<? super T,? extends U> fn)
- Specified by:
thenApplyAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenApplyAsync
public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync(java.util.function.Function<? super T,? extends U> fn, java.util.concurrent.Executor executor)
- Specified by:
thenApplyAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenAccept
public java.util.concurrent.CompletionStage<java.lang.Void> thenAccept(java.util.function.Consumer<? super T> action)
- Specified by:
thenAccept
in interfacejava.util.concurrent.CompletionStage<T>
-
thenAcceptAsync
public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T> action)
- Specified by:
thenAcceptAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenAcceptAsync
public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)
- Specified by:
thenAcceptAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenRun
public java.util.concurrent.CompletionStage<java.lang.Void> thenRun(java.lang.Runnable action)
- Specified by:
thenRun
in interfacejava.util.concurrent.CompletionStage<T>
-
thenRunAsync
public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(java.lang.Runnable action)
- Specified by:
thenRunAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenRunAsync
public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(java.lang.Runnable action, java.util.concurrent.Executor executor)
- Specified by:
thenRunAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenCombine
public <U,V> java.util.concurrent.CompletionStage<V> thenCombine(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends V> fn)
- Specified by:
thenCombine
in interfacejava.util.concurrent.CompletionStage<T>
-
thenCombineAsync
public <U,V> java.util.concurrent.CompletionStage<V> thenCombineAsync(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,? super U,? extends V> fn)
- Specified by:
thenCombineAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenCombineAsync
public <U,V> java.util.concurrent.CompletionStage<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)
- Specified by:
thenCombineAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenAcceptBoth
public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBoth(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,? super U> action)
- Specified by:
thenAcceptBoth
in interfacejava.util.concurrent.CompletionStage<T>
-
thenAcceptBothAsync
public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,? super U> action)
- Specified by:
thenAcceptBothAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenAcceptBothAsync
public <U> java.util.concurrent.CompletionStage<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)
- Specified by:
thenAcceptBothAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
runAfterBoth
public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBoth(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
- Specified by:
runAfterBoth
in interfacejava.util.concurrent.CompletionStage<T>
-
runAfterBothAsync
public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
- Specified by:
runAfterBothAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
runAfterBothAsync
public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)
- Specified by:
runAfterBothAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
applyToEither
public <U> java.util.concurrent.CompletionStage<U> applyToEither(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn)
- Specified by:
applyToEither
in interfacejava.util.concurrent.CompletionStage<T>
-
applyToEitherAsync
public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn)
- Specified by:
applyToEitherAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
applyToEitherAsync
public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,U> fn, java.util.concurrent.Executor executor)
- Specified by:
applyToEitherAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
acceptEither
public java.util.concurrent.CompletionStage<java.lang.Void> acceptEither(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)
- Specified by:
acceptEither
in interfacejava.util.concurrent.CompletionStage<T>
-
acceptEitherAsync
public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)
- Specified by:
acceptEitherAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
acceptEitherAsync
public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)
- Specified by:
acceptEitherAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
runAfterEither
public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEither(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
- Specified by:
runAfterEither
in interfacejava.util.concurrent.CompletionStage<T>
-
runAfterEitherAsync
public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)
- Specified by:
runAfterEitherAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
runAfterEitherAsync
public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)
- Specified by:
runAfterEitherAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenCompose
public <U> java.util.concurrent.CompletionStage<U> thenCompose(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn)
- Specified by:
thenCompose
in interfacejava.util.concurrent.CompletionStage<T>
-
thenComposeAsync
public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn)
- Specified by:
thenComposeAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
thenComposeAsync
public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync(java.util.function.Function<? super T,? extends java.util.concurrent.CompletionStage<U>> fn, java.util.concurrent.Executor executor)
- Specified by:
thenComposeAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
exceptionally
public java.util.concurrent.CompletionStage<T> exceptionally(java.util.function.Function<java.lang.Throwable,? extends T> fn)
- Specified by:
exceptionally
in interfacejava.util.concurrent.CompletionStage<T>
-
whenComplete
public java.util.concurrent.CompletionStage<T> whenComplete(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action)
- Specified by:
whenComplete
in interfacejava.util.concurrent.CompletionStage<T>
-
whenCompleteAsync
public java.util.concurrent.CompletionStage<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action)
- Specified by:
whenCompleteAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
whenCompleteAsync
public java.util.concurrent.CompletionStage<T> whenCompleteAsync(java.util.function.BiConsumer<? super T,? super java.lang.Throwable> action, java.util.concurrent.Executor executor)
- Specified by:
whenCompleteAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
handle
public <U> java.util.concurrent.CompletionStage<U> handle(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn)
- Specified by:
handle
in interfacejava.util.concurrent.CompletionStage<T>
-
handleAsync
public <U> java.util.concurrent.CompletionStage<U> handleAsync(java.util.function.BiFunction<? super T,java.lang.Throwable,? extends U> fn)
- Specified by:
handleAsync
in interfacejava.util.concurrent.CompletionStage<T>
-
-