Merge branch 'feature_blocklist_parameter' of https://github.com/catinred2/jedis into catinred2-feature_blocklist_parameter
Conflicts: src/main/java/redis/clients/jedis/Jedis.java src/main/java/redis/clients/jedis/JedisCluster.java
This commit is contained in:
@@ -3469,4 +3469,30 @@ public class Jedis extends BinaryJedis implements JedisCommands,
|
|||||||
return client.getStatusCodeReply();
|
return client.getStatusCodeReply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> blpop(int timeout, String key) {
|
||||||
|
checkIsInMulti();
|
||||||
|
List<String> args = new ArrayList<String>();
|
||||||
|
args.add(key);
|
||||||
|
args.add(String.valueOf(timeout));
|
||||||
|
client.blpop(args.toArray(new String[args.size()]));
|
||||||
|
client.setTimeoutInfinite();
|
||||||
|
final List<String> multiBulkReply = client.getMultiBulkReply();
|
||||||
|
client.rollbackTimeout();
|
||||||
|
return multiBulkReply;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> brpop(int timeout, String key) {
|
||||||
|
checkIsInMulti();
|
||||||
|
List<String> args = new ArrayList<String>();
|
||||||
|
args.add(key);
|
||||||
|
args.add(String.valueOf(timeout));
|
||||||
|
client.brpop(args.toArray(new String[args.size()]));
|
||||||
|
client.setTimeoutInfinite();
|
||||||
|
final List<String> multiBulkReply = client.getMultiBulkReply();
|
||||||
|
client.rollbackTimeout();
|
||||||
|
return multiBulkReply;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1536,4 +1536,25 @@ public class JedisCluster implements JedisCommands, BasicCommands, Closeable {
|
|||||||
}.run(key);
|
}.run(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> blpop(final int timeout, final String key) {
|
||||||
|
return new JedisClusterCommand<List<String>>(connectionHandler,
|
||||||
|
timeout, maxRedirections) {
|
||||||
|
@Override
|
||||||
|
public List<String> execute(Jedis connection) {
|
||||||
|
return connection.blpop(timeout,key);
|
||||||
|
}
|
||||||
|
}.run(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> brpop(final int timeout, final String key) {
|
||||||
|
return new JedisClusterCommand<List<String>>(connectionHandler,
|
||||||
|
timeout, maxRedirections) {
|
||||||
|
@Override
|
||||||
|
public List<String> execute(Jedis connection) {
|
||||||
|
return connection.brpop(timeout,key);
|
||||||
|
}
|
||||||
|
}.run(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,8 +213,12 @@ public interface JedisCommands {
|
|||||||
|
|
||||||
List<String> blpop(String arg);
|
List<String> blpop(String arg);
|
||||||
|
|
||||||
|
List<String> blpop(int timeout, String key);
|
||||||
|
|
||||||
List<String> brpop(String arg);
|
List<String> brpop(String arg);
|
||||||
|
|
||||||
|
List<String> brpop(int timeout, String key);
|
||||||
|
|
||||||
Long del(String key);
|
Long del(String key);
|
||||||
|
|
||||||
String echo(String string);
|
String echo(String string);
|
||||||
|
|||||||
@@ -125,12 +125,18 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands,
|
|||||||
Jedis j = getShard(arg);
|
Jedis j = getShard(arg);
|
||||||
return j.blpop(arg);
|
return j.blpop(arg);
|
||||||
}
|
}
|
||||||
|
public List<String> blpop(int timeout,String key){
|
||||||
|
Jedis j = getShard(key);
|
||||||
|
return j.blpop(timeout,key);
|
||||||
|
}
|
||||||
public List<String> brpop(String arg) {
|
public List<String> brpop(String arg) {
|
||||||
Jedis j = getShard(arg);
|
Jedis j = getShard(arg);
|
||||||
return j.brpop(arg);
|
return j.brpop(arg);
|
||||||
}
|
}
|
||||||
|
public List<String> brpop(int timeout,String key) {
|
||||||
|
Jedis j = getShard(key);
|
||||||
|
return j.brpop(timeout,key);
|
||||||
|
}
|
||||||
public Long decrBy(String key, long integer) {
|
public Long decrBy(String key, long integer) {
|
||||||
Jedis j = getShard(key);
|
Jedis j = getShard(key);
|
||||||
return j.decrBy(key, integer);
|
return j.decrBy(key, integer);
|
||||||
|
|||||||
Reference in New Issue
Block a user