Package org.redisson.api
Interface RFuture<V>
- Type Parameters:
V- type of value
- All Superinterfaces:
CompletionStage<V>,Future<V>
- All Known Subinterfaces:
RExecutorBatchFuture,RExecutorFuture<V>,RScheduledFuture<V>
- All Known Implementing Classes:
CompletableFutureWrapper,RedissonExecutorBatchFuture,RedissonExecutorFuture,RedissonScheduledFuture
Represents the result of an asynchronous computation
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionawait()Deprecated.booleanawait(long timeoutMillis) Deprecated.booleanDeprecated.Deprecated.booleanawaitUninterruptibly(long timeoutMillis) Deprecated.booleanawaitUninterruptibly(long timeout, TimeUnit unit) Deprecated.cause()Deprecated.getNow()Deprecated.booleanDeprecated.join()Deprecated.voidonComplete(BiConsumer<? super V, ? super Throwable> action) Deprecated.sync()Deprecated.Deprecated.Methods inherited from interface java.util.concurrent.CompletionStage
acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, 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
-
Method Details
-
isSuccess
Deprecated.Use snippet below instead.return toCompletableFuture().isDone() && !toCompletableFuture().isCompletedExceptionally();- Returns:
trueif future was completed successfully
-
cause
Deprecated.Use snippet below instead.if (toCompletableFuture().isDone()) { try { toCompletableFuture().getNow(null); } catch (CompletionException e) { return e.getCause(); } catch (CancellationException e) { return e; } } return null;- Returns:
- the cause of the failure.
nullif succeeded or this future is not completed yet.
-
getNow
Deprecated.Use snippet below instead.try { return toCompletableFuture().getNow(null); } catch (Exception e) { return null; }- Returns:
- object
-
join
Deprecated.Use toCompletableFuture().join() method instead- Returns:
- the result value
-
await
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }- Parameters:
timeout- - wait timeoutunit- - time unit- Returns:
trueif and only if the future was completed within the specified time limit- Throws:
InterruptedException- if the current thread was interrupted
-
await
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }- Parameters:
timeoutMillis- - timeout value- Returns:
trueif and only if the future was completed within the specified time limit- Throws:
InterruptedException- if the current thread was interrupted
-
sync
Deprecated.Use toCompletableFuture().get() method instead- Returns:
- Future object
- Throws:
InterruptedException- if the current thread was interrupted
-
syncUninterruptibly
Deprecated.Use toCompletableFuture().join() method instead- Returns:
- Future object
-
await
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }- Returns:
- Future object
- Throws:
InterruptedException- if the current thread was interrupted
-
awaitUninterruptibly
Deprecated.Use snippet below instead.try { rFuture.toCompletableFuture().join(); } catch (Exception e) { // skip }- Returns:
- Future object
-
awaitUninterruptibly
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }- Parameters:
timeout- - timeout valueunit- - timeout unit value- Returns:
trueif and only if the future was completed within the specified time limit
-
awaitUninterruptibly
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }- Parameters:
timeoutMillis- - timeout value- Returns:
trueif and only if the future was completed within the specified time limit
-
onComplete
Deprecated.Use whenComplete() method instead- Parameters:
action- - callback
-