Package org.redisson.misc
Interface RPromise<T>
-
- Type Parameters:
T- type
- All Superinterfaces:
CompletionStage<T>,Future<T>,RFuture<T>
- All Known Implementing Classes:
RedissonPromise
public interface RPromise<T> extends RFuture<T>
- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RPromise<T>await()Use snippet below instead.RPromise<T>awaitUninterruptibly()Use snippet below instead.booleanhasListeners()booleansetUncancellable()Make this future impossible to cancel.RPromise<T>sync()Use toCompletableFuture().get() method insteadRPromise<T>syncUninterruptibly()Use toCompletableFuture().join() method insteadbooleantryFailure(Throwable cause)Marks this future as a failure and notifies all listeners.booleantrySuccess(T result)Marks this future as a success and notifies all listeners.-
Methods inherited from interface java.util.concurrent.CompletionStage
acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Methods inherited from interface org.redisson.api.RFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, cause, getNow, isSuccess, join, onComplete
-
-
-
-
Method Detail
-
trySuccess
boolean trySuccess(T result)
Marks this future as a success and notifies all listeners.- Parameters:
result- object- Returns:
trueif and only if successfully marked this future as a success. Otherwisefalsebecause this future is already marked as either a success or a failure.
-
tryFailure
boolean tryFailure(Throwable cause)
Marks this future as a failure and notifies all listeners.- Parameters:
cause- object- Returns:
trueif and only if successfully marked this future as a failure. Otherwisefalsebecause this future is already marked as either a success or a failure.
-
setUncancellable
boolean setUncancellable()
Make this future impossible to cancel.- Returns:
trueif and only if successfully marked this future as uncancellable or it is already done without being cancelled.falseif this future has been cancelled already.
-
await
RPromise<T> await() throws InterruptedException
Description copied from interface:RFutureUse snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }- Specified by:
awaitin interfaceRFuture<T>- Returns:
- Future object
- Throws:
InterruptedException- if the current thread was interrupted
-
awaitUninterruptibly
RPromise<T> awaitUninterruptibly()
Description copied from interface:RFutureUse snippet below instead.try { rFuture.toCompletableFuture().join(); } catch (Exception e) { // skip }- Specified by:
awaitUninterruptiblyin interfaceRFuture<T>- Returns:
- Future object
-
sync
RPromise<T> sync() throws InterruptedException
Description copied from interface:RFutureUse toCompletableFuture().get() method instead- Specified by:
syncin interfaceRFuture<T>- Returns:
- Future object
- Throws:
InterruptedException- if the current thread was interrupted
-
syncUninterruptibly
RPromise<T> syncUninterruptibly()
Description copied from interface:RFutureUse toCompletableFuture().join() method instead- Specified by:
syncUninterruptiblyin interfaceRFuture<T>- Returns:
- Future object
-
hasListeners
boolean hasListeners()
-
-