public interface Future<V> extends io.netty.util.concurrent.Future<V>, com.google.common.util.concurrent.ListenableFuture<V>, Awaitable
Awaitable
abstraction, to overall improve coherency and clarity in the codebase.Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable
Modifier and Type | Method and Description |
---|---|
Future<V> |
addCallback(java.util.function.BiConsumer<? super V,java.lang.Throwable> callback)
Support
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor) natively |
Future<V> |
addCallback(java.util.function.BiConsumer<? super V,java.lang.Throwable> callback,
java.util.concurrent.Executor executor)
Support
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor) natively |
Future<V> |
addCallback(java.util.function.Consumer<? super V> onSuccess,
java.util.function.Consumer<? super java.lang.Throwable> onFailure)
Support
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor) natively |
Future<V> |
addCallback(java.util.function.Consumer<? super V> onSuccess,
java.util.function.Consumer<? super java.lang.Throwable> onFailure,
java.util.concurrent.Executor executor)
Support
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor) natively |
Future<V> |
addCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback)
Support
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor) natively |
Future<V> |
addCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback,
java.util.concurrent.Executor executor)
Support
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor) natively |
Future<V> |
addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> genericFutureListener) |
void |
addListener(java.lang.Runnable runnable)
Invoke
runnable on completion. |
void |
addListener(java.lang.Runnable runnable,
java.util.concurrent.Executor executor)
Invoke
runnable on completion, using executor . |
Future<V> |
addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... genericFutureListeners) |
Future<V> |
await()
Wait indefinitely for this future to complete, throwing any interrupt
|
default boolean |
await(long l)
Deprecated.
|
Future<V> |
awaitThrowUncheckedOnInterrupt()
Wait indefinitely for this promise to complete, throwing any interrupt as an UncheckedInterruptedException
|
Future<V> |
awaitUninterruptibly()
Wait indefinitely for this future to complete
|
default boolean |
awaitUninterruptibly(long l)
Deprecated.
|
default <T> Future<T> |
flatMap(java.util.function.Function<? super V,? extends Future<T>> flatMapper)
Support
Futures.transformAsync(ListenableFuture, AsyncFunction, Executor) natively |
<T> Future<T> |
flatMap(java.util.function.Function<? super V,? extends Future<T>> flatMapper,
java.util.concurrent.Executor executor)
Support
Futures.transformAsync(ListenableFuture, AsyncFunction, Executor) natively |
default <T> Future<T> |
map(java.util.function.Function<? super V,? extends T> mapper)
Support
Futures.transform(ListenableFuture, com.google.common.base.Function, Executor) natively |
<T> Future<T> |
map(java.util.function.Function<? super V,? extends T> mapper,
java.util.concurrent.Executor executor)
Support
Futures.transform(ListenableFuture, com.google.common.base.Function, Executor) natively |
java.util.concurrent.Executor |
notifyExecutor() |
Future<V> |
removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> genericFutureListener) |
Future<V> |
removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... genericFutureListeners) |
default void |
rethrowIfFailed() |
default Future<V> |
sync()
waits for completion; in case of failure rethrows the original exception without a new wrapping exception
so may cause problems for reporting stack traces
|
default Future<V> |
syncThrowUncheckedOnInterrupt()
waits for completion; in case of failure rethrows the original exception without a new wrapping exception
so may cause problems for reporting stack traces
|
default Future<V> |
syncUninterruptibly()
waits for completion; in case of failure rethrows the original exception without a new wrapping exception
so may cause problems for reporting stack traces
|
await, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
await, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUntil, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly
Future<V> await() throws java.lang.InterruptedException
Future<V> awaitUninterruptibly()
awaitUninterruptibly
in interface Awaitable
Future<V> awaitThrowUncheckedOnInterrupt()
awaitThrowUncheckedOnInterrupt
in interface Awaitable
UncheckedInterruptedException
- if interrupteddefault void rethrowIfFailed()
default Future<V> sync() throws java.lang.InterruptedException
java.lang.InterruptedException
default Future<V> syncUninterruptibly()
default Future<V> syncThrowUncheckedOnInterrupt()
@Deprecated default boolean await(long l) throws java.lang.InterruptedException
java.lang.InterruptedException
@Deprecated default boolean awaitUninterruptibly(long l)
Future<V> addCallback(java.util.function.BiConsumer<? super V,java.lang.Throwable> callback)
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelyFuture<V> addCallback(java.util.function.BiConsumer<? super V,java.lang.Throwable> callback, java.util.concurrent.Executor executor)
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelyFuture<V> addCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback)
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelyFuture<V> addCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback, java.util.concurrent.Executor executor)
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelyFuture<V> addCallback(java.util.function.Consumer<? super V> onSuccess, java.util.function.Consumer<? super java.lang.Throwable> onFailure)
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelyFuture<V> addCallback(java.util.function.Consumer<? super V> onSuccess, java.util.function.Consumer<? super java.lang.Throwable> onFailure, java.util.concurrent.Executor executor)
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelydefault <T> Future<T> map(java.util.function.Function<? super V,? extends T> mapper)
Futures.transform(ListenableFuture, com.google.common.base.Function, Executor)
natively<T> Future<T> map(java.util.function.Function<? super V,? extends T> mapper, java.util.concurrent.Executor executor)
Futures.transform(ListenableFuture, com.google.common.base.Function, Executor)
nativelydefault <T> Future<T> flatMap(java.util.function.Function<? super V,? extends Future<T>> flatMapper)
Futures.transformAsync(ListenableFuture, AsyncFunction, Executor)
natively<T> Future<T> flatMap(java.util.function.Function<? super V,? extends Future<T>> flatMapper, java.util.concurrent.Executor executor)
Futures.transformAsync(ListenableFuture, AsyncFunction, Executor)
nativelyvoid addListener(java.lang.Runnable runnable, java.util.concurrent.Executor executor)
runnable
on completion, using executor
.
Tasks are submitted to their executors in the order they were added to this Future.addListener
in interface com.google.common.util.concurrent.ListenableFuture<V>
void addListener(java.lang.Runnable runnable)
runnable
on completion. Depending on the implementation and its configuration, this
may be executed immediately by the notifying/completing thread, or asynchronously by an executor.
Tasks are executed, or submitted to the executor, in the order they were added to this Future.java.util.concurrent.Executor notifyExecutor()
Future<V> addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> genericFutureListener)
Future<V> addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... genericFutureListeners)
Future<V> removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> genericFutureListener)
Copyright © 2009- The Apache Software Foundation