Implemented BRPOP
This commit is contained in:
@@ -413,4 +413,8 @@ public class Client extends Connection {
|
||||
public void sort(String key, String dstkey) throws JedisException {
|
||||
sendCommand("SORT", key, "STORE", dstkey);
|
||||
}
|
||||
|
||||
public void brpop(String[] args) throws JedisException {
|
||||
sendCommand("BRPOP", args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,4 +530,16 @@ public class Jedis {
|
||||
client.sort(key, dstkey);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
public List<String> brpop(int timeout, String... keys)
|
||||
throws JedisException {
|
||||
List<String> args = new ArrayList<String>();
|
||||
for (String arg : keys) {
|
||||
args.add(arg);
|
||||
}
|
||||
args.add(String.valueOf(timeout));
|
||||
|
||||
client.brpop(args.toArray(new String[args.size()]));
|
||||
return client.getMultiBulkReply();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user