+ add support for [x]pushX commands on RedisConnection
+ add support for blockingRPopLPush on RedisConnection
This commit is contained in:
@@ -33,6 +33,10 @@ public interface RedisListCommands {
|
||||
|
||||
Long lPush(byte[] key, byte[] value);
|
||||
|
||||
Long rPushX(byte[] key, byte[] value);
|
||||
|
||||
Long lPushX(byte[] key, byte[] value);
|
||||
|
||||
Long lLen(byte[] key);
|
||||
|
||||
List<byte[]> lRange(byte[] key, long start, long end);
|
||||
@@ -56,4 +60,6 @@ public interface RedisListCommands {
|
||||
List<byte[]> bRPop(int timeout, byte[]... keys);
|
||||
|
||||
byte[] rPopLPush(byte[] srcKey, byte[] dstKey);
|
||||
|
||||
byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey);
|
||||
}
|
||||
|
||||
@@ -785,6 +785,42 @@ public class JedisConnection implements RedisConnection {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return jedis.brpoplpush(srcKey, dstKey, timeout).getBytes();
|
||||
} catch (Exception ex) {
|
||||
throw convertJedisAccessException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lPushX(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return jedis.lpushx(key, value);
|
||||
} catch (Exception ex) {
|
||||
throw convertJedisAccessException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPushX(byte[] key, byte[] value) {
|
||||
try {
|
||||
if (isQueueing()) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return jedis.rpushx(key, value);
|
||||
} catch (Exception ex) {
|
||||
throw convertJedisAccessException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Set commands
|
||||
|
||||
@@ -516,6 +516,21 @@ public class JredisConnection implements RedisConnection {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long lPushX(byte[] key, byte[] value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long rPushX(byte[] key, byte[] value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Set commands
|
||||
|
||||
Reference in New Issue
Block a user