public interface Promise<V> extends io.netty.util.concurrent.Promise<V>, Future<V>
Promise
with our Future
API
to improve clarity and coherence in the codebase.Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable
Modifier and Type | Method and Description |
---|---|
Promise<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 |
Promise<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 |
Promise<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 |
Promise<V> |
addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> var1) |
Promise<V> |
addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... var1) |
Promise<V> |
await()
Wait indefinitely for this promise to complete, throwing any interrupt
|
Promise<V> |
awaitThrowUncheckedOnInterrupt()
Wait indefinitely for this promise to complete, throwing any interrupt as an UncheckedInterruptedException
|
Promise<V> |
awaitUninterruptibly()
Wait indefinitely for this promise to complete
|
static <V> io.netty.util.concurrent.GenericFutureListener<? extends Future<V>> |
listener(java.util.concurrent.ExecutorService executor,
com.google.common.util.concurrent.FutureCallback<V> callback) |
static <V> io.netty.util.concurrent.GenericFutureListener<? extends Future<V>> |
listener(com.google.common.util.concurrent.FutureCallback<V> callback) |
Promise<V> |
removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> var1) |
Promise<V> |
removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... var1) |
Promise<V> |
setFailure(java.lang.Throwable throwable)
Complete the promise abnormally if not already complete
|
Promise<V> |
setSuccess(V v)
Complete the promise successfully if not already complete
|
boolean |
setUncancellableExclusive()
Prevent a future caller from cancelling this promise
|
Promise<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
|
Promise<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
|
setUncancellable, tryFailure, trySuccess
addCallback, addCallback, addCallback, addListener, addListener, await, awaitUninterruptibly, flatMap, flatMap, map, map, notifyExecutor, rethrowIfFailed, syncThrowUncheckedOnInterrupt
await, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
await, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUntil, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly
static <V> io.netty.util.concurrent.GenericFutureListener<? extends Future<V>> listener(com.google.common.util.concurrent.FutureCallback<V> callback)
static <V> io.netty.util.concurrent.GenericFutureListener<? extends Future<V>> listener(java.util.concurrent.ExecutorService executor, com.google.common.util.concurrent.FutureCallback<V> callback)
Promise<V> addCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback)
Future
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelyPromise<V> addCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback, java.util.concurrent.Executor executor)
Future
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelyPromise<V> addCallback(java.util.function.Consumer<? super V> onSuccess, java.util.function.Consumer<? super java.lang.Throwable> onFailure)
Future
Futures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)
nativelyPromise<V> addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> var1)
addListener
in interface io.netty.util.concurrent.Promise<V>
Promise<V> addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... var1)
addListeners
in interface io.netty.util.concurrent.Promise<V>
Promise<V> removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> var1)
removeListener
in interface io.netty.util.concurrent.Promise<V>
Promise<V> removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... var1)
removeListeners
in interface io.netty.util.concurrent.Promise<V>
Promise<V> setSuccess(V v) throws java.lang.IllegalStateException
setSuccess
in interface io.netty.util.concurrent.Promise<V>
java.lang.IllegalStateException
- if already setPromise<V> setFailure(java.lang.Throwable throwable) throws java.lang.IllegalStateException
setFailure
in interface io.netty.util.concurrent.Promise<V>
java.lang.IllegalStateException
- if already setboolean setUncancellableExclusive()
Promise<V> await() throws java.lang.InterruptedException
Promise<V> awaitUninterruptibly()
awaitUninterruptibly
in interface Awaitable
awaitUninterruptibly
in interface io.netty.util.concurrent.Promise<V>
Promise<V> awaitThrowUncheckedOnInterrupt()
awaitThrowUncheckedOnInterrupt
in interface Awaitable
UncheckedInterruptedException
- if interruptedPromise<V> sync() throws java.lang.InterruptedException
sync
in interface io.netty.util.concurrent.Promise<V>
java.lang.InterruptedException
Copyright © 2009-2022 The Apache Software Foundation