Package io.lettuce.core.cluster
Class PipelinedRedisFuture<V>
- java.lang.Object
-
- java.util.concurrent.CompletableFuture<V>
-
- io.lettuce.core.cluster.PipelinedRedisFuture<V>
-
- All Implemented Interfaces:
RedisFuture<V>
,CompletionStage<V>
,Future<V>
public class PipelinedRedisFuture<V> extends CompletableFuture<V> implements RedisFuture<V>
Pipelining for commands that are executed on multiple cluster nodes. Merges results and emits one composite result.- Author:
- Mark Paluch
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
-
Constructor Summary
Constructors Constructor Description PipelinedRedisFuture(CompletionStage<V> completionStage)
PipelinedRedisFuture(CompletionStage<V> completionStage, Function<V,V> converter)
PipelinedRedisFuture(Map<?,? extends CompletionStage<?>> executions, Function<PipelinedRedisFuture<V>,V> converter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
await(long timeout, TimeUnit unit)
Wait up to the specified time for the command output to become available.boolean
complete(V value)
boolean
completeExceptionally(Throwable ex)
String
getError()
-
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, completeAsync, completeAsync, completedFuture, completedStage, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
Constructor Detail
-
PipelinedRedisFuture
public PipelinedRedisFuture(CompletionStage<V> completionStage)
-
PipelinedRedisFuture
public PipelinedRedisFuture(CompletionStage<V> completionStage, Function<V,V> converter)
-
PipelinedRedisFuture
public PipelinedRedisFuture(Map<?,? extends CompletionStage<?>> executions, Function<PipelinedRedisFuture<V>,V> converter)
-
-
Method Detail
-
complete
public boolean complete(V value)
- Overrides:
complete
in classCompletableFuture<V>
-
completeExceptionally
public boolean completeExceptionally(Throwable ex)
- Overrides:
completeExceptionally
in classCompletableFuture<V>
-
getError
public String getError()
- Specified by:
getError
in interfaceRedisFuture<V>
- Returns:
- error text, if any error occurred.
-
await
public boolean await(long timeout, TimeUnit unit) throws InterruptedException
Description copied from interface:RedisFuture
Wait up to the specified time for the command output to become available.- Specified by:
await
in interfaceRedisFuture<V>
- Parameters:
timeout
- Maximum time to wait for a result.unit
- Unit of time for the timeout.- Returns:
true
if the output became available.- Throws:
InterruptedException
- if the current thread is interrupted while waiting
-
-