Skip to content

Commit

Permalink
Polishing #1433
Browse files Browse the repository at this point in the history
Tweak Javadoc.
  • Loading branch information
mp911de committed Sep 28, 2020
1 parent 811789b commit 0268655
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/main/java/io/lettuce/core/protocol/RedisCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,28 @@ public interface RedisCommand<K, V, T> {
void complete();

/**
* Cancel a command.
* Complete this command by attaching the given {@link Throwable exception}.
*
* @param throwable the exception
* @return {@code true} if this invocation caused this CompletableFuture to transition to a completed state, else
* {@code false}
*/
void cancel();
boolean completeExceptionally(Throwable throwable);

/**
*
* @return the current command args
* Attempts to cancel execution of this command. This attempt will fail if the task has already completed, has already been
* cancelled, or could not be cancelled for some other reason.
*/
CommandArgs<K, V> getArgs();
void cancel();

/**
*
* @param throwable the exception
* @return {@code true} if this invocation caused this CompletableFuture to transition to a completed state, else
* {@code false}
* @return the current command args.
*/
boolean completeExceptionally(Throwable throwable);
CommandArgs<K, V> getArgs();

/**
*
* @return the Redis command type like {@literal SADD}, {@literal HMSET}, {@literal QUIT}.
* @return the Redis command type like {@code SADD}, {@code HMSET}, {@code QUIT}.
*/
ProtocolKeyword getType();

Expand All @@ -77,14 +78,19 @@ public interface RedisCommand<K, V, T> {
void encode(ByteBuf buf);

/**
* Returns {@code true} if this task was cancelled before it completed normally.
*
* @return true if the command is cancelled.
* @return {@code true} if the command was cancelled before it completed normally.
*/
boolean isCancelled();

/**
* Returns {@code true} if this task completed.
*
* Completion may be due to normal termination, an exception, or cancellation. In all of these cases, this method will
* return {@code true}.
*
* @return true if the command is completed.
* @return {@code true} if this task completed.
*/
boolean isDone();

Expand Down

0 comments on commit 0268655

Please sign in to comment.