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
public interface RFuture<V> extends Future<V>, CompletionStage<V>
Represents the result of an asynchronous computation- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description RFuture<V>
await()
Deprecated.boolean
await(long timeoutMillis)
Deprecated.boolean
await(long timeout, TimeUnit unit)
Deprecated.RFuture<V>
awaitUninterruptibly()
Deprecated.boolean
awaitUninterruptibly(long timeoutMillis)
Deprecated.boolean
awaitUninterruptibly(long timeout, TimeUnit unit)
Deprecated.Throwable
cause()
Deprecated.V
getNow()
Deprecated.boolean
isSuccess()
Deprecated.V
join()
Deprecated.void
onComplete(BiConsumer<? super V,? super Throwable> action)
Deprecated.RFuture<V>
sync()
Deprecated.RFuture<V>
syncUninterruptibly()
Deprecated.-
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
-
-
-
-
Method Detail
-
isSuccess
@Deprecated boolean isSuccess()
Deprecated.Use snippet below instead.return toCompletableFuture().isDone() && !toCompletableFuture().isCompletedExceptionally();
- Returns:
true
if future was completed successfully
-
cause
@Deprecated Throwable 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.
null
if succeeded or this future is not completed yet.
-
getNow
@Deprecated V getNow()
Deprecated.Use snippet below instead.try { return toCompletableFuture().getNow(null); } catch (Exception e) { return null; }
- Returns:
- object
-
join
@Deprecated V join()
Deprecated.Use toCompletableFuture().join() method instead- Returns:
- the result value
-
await
@Deprecated boolean await(long timeout, TimeUnit unit) throws InterruptedException
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }
- Parameters:
timeout
- - wait timeoutunit
- - time unit- Returns:
true
if and only if the future was completed within the specified time limit- Throws:
InterruptedException
- if the current thread was interrupted
-
await
@Deprecated boolean await(long timeoutMillis) throws InterruptedException
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }
- Parameters:
timeoutMillis
- - timeout value- Returns:
true
if and only if the future was completed within the specified time limit- Throws:
InterruptedException
- if the current thread was interrupted
-
sync
@Deprecated RFuture<V> sync() throws InterruptedException
Deprecated.Use toCompletableFuture().get() method instead- Returns:
- Future object
- Throws:
InterruptedException
- if the current thread was interrupted
-
syncUninterruptibly
@Deprecated RFuture<V> syncUninterruptibly()
Deprecated.Use toCompletableFuture().join() method instead- Returns:
- Future object
-
await
@Deprecated RFuture<V> await() throws InterruptedException
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 RFuture<V> awaitUninterruptibly()
Deprecated.Use snippet below instead.try { rFuture.toCompletableFuture().join(); } catch (Exception e) { // skip }
- Returns:
- Future object
-
awaitUninterruptibly
@Deprecated boolean awaitUninterruptibly(long timeout, TimeUnit unit)
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }
- Parameters:
timeout
- - timeout valueunit
- - timeout unit value- Returns:
true
if and only if the future was completed within the specified time limit
-
awaitUninterruptibly
@Deprecated boolean awaitUninterruptibly(long timeoutMillis)
Deprecated.Use snippet below instead.try { toCompletableFuture().get(); } catch (Exception e) { // skip }
- Parameters:
timeoutMillis
- - timeout value- Returns:
true
if and only if the future was completed within the specified time limit
-
onComplete
@Deprecated void onComplete(BiConsumer<? super V,? super Throwable> action)
Deprecated.Use whenComplete() method instead- Parameters:
action
- - callback
-
-