Skip to content

Commit

Permalink
Polishing #629
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Oct 17, 2017
1 parent 38d7a7e commit 0adcf82
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/com/lambdaworks/redis/RedisException.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class RedisException extends RuntimeException {

/**
* Create a {@code RedisException} with the specified detail message.
*
*
* @param msg the detail message.
*/
public RedisException(String msg) {
Expand All @@ -35,18 +35,17 @@ public RedisException(String msg) {

/**
* Create a {@code RedisException} with the specified detail message and nested exception.
*
*
* @param msg the detail message.
* @param cause the nested exception.
*/
public RedisException(String msg, Throwable e) {
super(msg, e);
public RedisException(String msg, Throwable cause) {
super(msg, cause);
}

/**
* Create a {@code RedisException} with the specified nested exception.
*
* @param msg the detail message.
*
* @param cause the nested exception.
*/
public RedisException(Throwable cause) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ private static <K, V> StatefulRedisMasterSlaveConnection<K, V> connectSentinel(R
StatefulRedisMasterSlaveConnectionImpl<K, V> connection = new StatefulRedisMasterSlaveConnectionImpl<>(channelWriter,
codec, redisURI.getTimeout(), redisURI.getUnit());

connection.setOptions(redisClient.getOptions());

Runnable runnable = () -> {
try {

Expand Down Expand Up @@ -228,6 +230,8 @@ private static <K, V> StatefulRedisMasterSlaveConnection<K, V> connectMasterSlav
StatefulRedisMasterSlaveConnectionImpl<K, V> connection = new StatefulRedisMasterSlaveConnectionImpl<>(
channelWriter, codec, redisURI.getTimeout(), redisURI.getUnit());

connection.setOptions(redisClient.getOptions());

return connection;

} catch (RuntimeException e) {
Expand Down Expand Up @@ -264,6 +268,8 @@ private static <K, V> StatefulRedisMasterSlaveConnection<K, V> connectStaticMast
StatefulRedisMasterSlaveConnectionImpl<K, V> connection = new StatefulRedisMasterSlaveConnectionImpl<>(
channelWriter, codec, seedNode.getTimeout(), seedNode.getUnit());

connection.setOptions(redisClient.getOptions());

return connection;

} catch (RuntimeException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@
import java.util.function.Consumer;

/**
* Extension to commands that provide registration of command completion callbacks. Completion callbacks allow execution of
* tasks after successive, failed or any completion outcome. A callback must be non-blocking. Callback registration gives no
* guarantee over callback ordering.
*
* @author Mark Paluch
*/
public interface CompleteableCommand<T> {

/**
* Register a command callback for command completion that notifies the callback with the command result or the failure
* resulting from command completion.
*
* @param action must not be {@literal null}.
*/
void onComplete(Consumer<? super T> action);

}

0 comments on commit 0adcf82

Please sign in to comment.