Interface Promise<V>
- All Superinterfaces:
Awaitable,io.netty.util.concurrent.Future<V>,Future<V>,Future<V>,com.google.common.util.concurrent.ListenableFuture<V>,io.netty.util.concurrent.Promise<V>
- All Known Implementing Classes:
AsyncChannelPromise,AsyncOneResponse,AsyncPromise,AsyncPromise.WithExecutor,SyncPromise,SyncPromise.WithExecutor
A Promise that integrates
Promise with our Future API
to improve clarity and coherence in the codebase.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable -
Method Summary
Modifier and TypeMethodDescriptionaddCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback, Executor executor) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddCallback(Consumer<? super V> onSuccess, Consumer<? super Throwable> onFailure) SupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)nativelyaddListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> var1) addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... var1) await()Wait indefinitely for this promise to complete, throwing any interruptWait indefinitely for this promise to complete, throwing any interrupt as an UncheckedInterruptedExceptionWait indefinitely for this promise to completestatic <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(ExecutorService executor, com.google.common.util.concurrent.FutureCallback<V> callback) removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> var1) removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... var1) setFailure(Throwable throwable) Complete the promise abnormally if not already completesetSuccess(V v) Complete the promise successfully if not already completebooleanPrevent a future caller from cancelling this promisesync()waits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack traceswaits for completion; in case of failure rethrows the original exception without a new wrapping exception so may cause problems for reporting stack tracesMethods inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
await, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUntil, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptiblyMethods inherited from interface io.netty.util.concurrent.Future
await, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccessMethods inherited from interface java.util.concurrent.Future
get, get, isCancelled, isDoneMethods inherited from interface org.apache.cassandra.utils.concurrent.Future
addCallback, addCallback, addCallback, addListener, addListener, await, awaitUninterruptibly, flatMap, flatMap, map, map, notifyExecutor, rethrowIfFailed, syncThrowUncheckedOnInterruptMethods inherited from interface io.netty.util.concurrent.Promise
setUncancellable, tryFailure, trySuccess
-
Method Details
-
listener
static <V> io.netty.util.concurrent.GenericFutureListener<? extends Future<V>> listener(com.google.common.util.concurrent.FutureCallback<V> callback) -
listener
static <V> io.netty.util.concurrent.GenericFutureListener<? extends Future<V>> listener(ExecutorService executor, com.google.common.util.concurrent.FutureCallback<V> callback) -
addCallback
Description copied from interface:FutureSupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively- Specified by:
addCallbackin interfaceFuture<V>
-
addCallback
Promise<V> addCallback(com.google.common.util.concurrent.FutureCallback<? super V> callback, Executor executor) Description copied from interface:FutureSupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively- Specified by:
addCallbackin interfaceFuture<V>
-
addCallback
Description copied from interface:FutureSupportFutures.addCallback(com.google.common.util.concurrent.ListenableFuture<V>, com.google.common.util.concurrent.FutureCallback<? super V>, java.util.concurrent.Executor)natively- Specified by:
addCallbackin interfaceFuture<V>
-
addListener
Promise<V> addListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> var1) - Specified by:
addListenerin interfaceio.netty.util.concurrent.Future<V>- Specified by:
addListenerin interfaceFuture<V>- Specified by:
addListenerin interfaceio.netty.util.concurrent.Promise<V>
-
addListeners
Promise<V> addListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... var1) - Specified by:
addListenersin interfaceio.netty.util.concurrent.Future<V>- Specified by:
addListenersin interfaceFuture<V>- Specified by:
addListenersin interfaceio.netty.util.concurrent.Promise<V>
-
removeListener
Promise<V> removeListener(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>> var1) - Specified by:
removeListenerin interfaceio.netty.util.concurrent.Future<V>- Specified by:
removeListenerin interfaceFuture<V>- Specified by:
removeListenerin interfaceio.netty.util.concurrent.Promise<V>
-
removeListeners
Promise<V> removeListeners(io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super V>>... var1) - Specified by:
removeListenersin interfaceio.netty.util.concurrent.Future<V>- Specified by:
removeListenersin interfaceFuture<V>- Specified by:
removeListenersin interfaceio.netty.util.concurrent.Promise<V>
-
setSuccess
Complete the promise successfully if not already complete- Specified by:
setSuccessin interfaceio.netty.util.concurrent.Promise<V>- Throws:
IllegalStateException- if already set
-
setFailure
Complete the promise abnormally if not already complete- Specified by:
setFailurein interfaceio.netty.util.concurrent.Promise<V>- Throws:
IllegalStateException- if already set
-
setUncancellableExclusive
boolean setUncancellableExclusive()Prevent a future caller from cancelling this promise- Returns:
- true iff this invocation set it to uncancellable, whether or not now uncancellable
-
await
Wait indefinitely for this promise to complete, throwing any interrupt -
awaitUninterruptibly
Wait indefinitely for this promise to complete- Specified by:
awaitUninterruptiblyin interfaceAwaitable- Specified by:
awaitUninterruptiblyin interfaceio.netty.util.concurrent.Future<V>- Specified by:
awaitUninterruptiblyin interfaceFuture<V>- Specified by:
awaitUninterruptiblyin interfaceio.netty.util.concurrent.Promise<V>
-
awaitThrowUncheckedOnInterrupt
Wait indefinitely for this promise to complete, throwing any interrupt as an UncheckedInterruptedException- Specified by:
awaitThrowUncheckedOnInterruptin interfaceAwaitable- Specified by:
awaitThrowUncheckedOnInterruptin interfaceFuture<V>- Throws:
UncheckedInterruptedException- if interrupted
-
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 -
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- Specified by:
syncUninterruptiblyin interfaceio.netty.util.concurrent.Future<V>- Specified by:
syncUninterruptiblyin interfaceFuture<V>- Specified by:
syncUninterruptiblyin interfaceio.netty.util.concurrent.Promise<V>
-