add blpop/brpop with timeout parameter interface to JedisCommands

This commit is contained in:
Ming
2014-08-14 10:37:28 +08:00
parent c62672e3a0
commit a30598b7cb
3 changed files with 53 additions and 0 deletions

View File

@@ -1474,4 +1474,26 @@ public class JedisCluster implements JedisCommands, BasicCommands {
}
}.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);
}
}