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:
thenApplyin 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:
thenApplyAsyncin 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:
thenApplyAsyncin interfacejava.util.concurrent.CompletionStage<T>
-
thenAccept
public java.util.concurrent.CompletionStage<java.lang.Void> thenAccept(java.util.function.Consumer<? super T> action)
- Specified by:
thenAcceptin interfacejava.util.concurrent.CompletionStage<T>
-
thenAcceptAsync
public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync(java.util.function.Consumer<? super T> action)
- Specified by:
thenAcceptAsyncin 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:
thenAcceptAsyncin interfacejava.util.concurrent.CompletionStage<T>
-
thenRun
public java.util.concurrent.CompletionStage<java.lang.Void> thenRun(java.lang.Runnable action)
- Specified by:
thenRunin interfacejava.util.concurrent.CompletionStage<T>
-
thenRunAsync
public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync(java.lang.Runnable action)
- Specified by:
thenRunAsyncin 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:
thenRunAsyncin 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:
thenCombinein 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:
thenCombineAsyncin 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:
thenCombineAsyncin 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:
thenAcceptBothin 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:
thenAcceptBothAsyncin 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:
thenAcceptBothAsyncin 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:
runAfterBothin 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:
runAfterBothAsyncin 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:
runAfterBothAsyncin 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:
applyToEitherin 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:
applyToEitherAsyncin 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:
applyToEitherAsyncin 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:
acceptEitherin 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:
acceptEitherAsyncin 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:
acceptEitherAsyncin 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:
runAfterEitherin 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:
runAfterEitherAsyncin 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:
runAfterEitherAsyncin 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:
thenComposein 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:
thenComposeAsyncin 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:
thenComposeAsyncin 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:
exceptionallyin 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:
whenCompletein 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:
whenCompleteAsyncin 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:
whenCompleteAsyncin 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:
handlein 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:
handleAsyncin interfacejava.util.concurrent.CompletionStage<T>
-
-