K - Key type.V - Value type.T - Command output type.public class AsyncCommand<K,V,T> extends CompletableFuture<T> implements RedisCommand<K,V,T>, RedisFuture<T>, CompleteableCommand<T>, DecoratedCommand<K,V,T>
CommandOutput object.CompletableFuture.AsynchronousCompletionTask| Modifier | Constructor and Description |
|---|---|
|
AsyncCommand(RedisCommand<K,V,T> command) |
protected |
AsyncCommand(RedisCommand<K,V,T> command,
int count) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
await(long timeout,
TimeUnit unit)
Wait up to the specified time for the command output to become available.
|
void |
cancel()
Cancel a command.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
void |
complete()
Mark this command complete and notify all waiting threads.
|
boolean |
completeExceptionally(Throwable ex) |
protected void |
completeResult() |
void |
encode(ByteBuf buf)
Encode the command.
|
boolean |
equals(Object o) |
CommandArgs<K,V> |
getArgs() |
RedisCommand<K,V,T> |
getDelegate()
The underlying command.
|
String |
getError() |
CommandOutput<K,V,T> |
getOutput()
Get the object that holds this command's output.
|
ProtocolKeyword |
getType() |
int |
hashCode() |
void |
onComplete(BiConsumer<? super T,Throwable> action)
Register a command callback for command completion that notifies the callback with the command result or the failure
resulting from command completion.
|
void |
onComplete(Consumer<? super T> action)
Register a command callback for successive command completion that notifies the callback with the command result.
|
void |
setOutput(CommandOutput<K,V,T> output)
Set a new output.
|
String |
toString() |
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completedFuture, exceptionally, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, obtrudeException, obtrudeValue, 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, whenComplete, whenCompleteAsync, whenCompleteAsyncclone, finalize, getClass, notify, notifyAll, wait, wait, waitisCancelled, isDoneacceptEither, 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, whenCompleteAsyncget, get, isCancelled, isDonepublic AsyncCommand(RedisCommand<K,V,T> command)
command - the command, must not be null.protected AsyncCommand(RedisCommand<K,V,T> command, int count)
command - the command, must not be null.public boolean await(long timeout,
TimeUnit unit)
await in interface RedisFuture<T>timeout - Maximum time to wait for a result.unit - Unit of time for the timeout.public CommandOutput<K,V,T> getOutput()
getOutput in interface RedisCommand<K,V,T>public void complete()
complete in interface RedisCommand<K,V,T>protected void completeResult()
public boolean completeExceptionally(Throwable ex)
completeExceptionally in interface RedisCommand<K,V,T>completeExceptionally in class CompletableFuture<T>ex - the exceptiontrue if this invocation caused this CompletableFuture to transition to a completed state, else
falsepublic boolean cancel(boolean mayInterruptIfRunning)
public String getError()
getError in interface RedisFuture<T>public CommandArgs<K,V> getArgs()
getArgs in interface RedisCommand<K,V,T>public String toString()
toString in class CompletableFuture<T>public ProtocolKeyword getType()
getType in interface RedisCommand<K,V,T>public void cancel()
RedisCommandcancel in interface RedisCommand<K,V,T>public void encode(ByteBuf buf)
RedisCommandencode in interface RedisCommand<K,V,T>buf - byte buffer to operate on.public void setOutput(CommandOutput<K,V,T> output)
RedisCommandsetOutput in interface RedisCommand<K,V,T>output - the new command outputpublic void onComplete(Consumer<? super T> action)
CompleteableCommandonComplete in interface CompleteableCommand<T>action - must not be null.public void onComplete(BiConsumer<? super T,Throwable> action)
CompleteableCommandonComplete in interface CompleteableCommand<T>action - must not be null.public RedisCommand<K,V,T> getDelegate()
DecoratedCommandgetDelegate in interface DecoratedCommand<K,V,T>Copyright © 2019 lettuce.io. All rights reserved.