use of redis.clients.jedis.Transaction in project leopard by tanhaichao.
the class RedisImpl method append.
@Override
public boolean append(final String key, final String value, final int seconds) {
return (Boolean) this.execute(new Invoker() {
@Override
public Object execute(Jedis jedis) {
Transaction transaction = jedis.multi();
transaction.append(key, value);
transaction.expire(key, seconds);
transaction.exec();
return true;
}
});
}
use of redis.clients.jedis.Transaction in project leopard by tanhaichao.
the class RedisImpl method set.
@Override
public boolean set(final List<String> keyList, final List<String> valueList) {
RedisUtil.checkList(keyList, valueList);
return (Boolean) this.execute(new Invoker() {
@Override
public Object execute(Jedis jedis) {
Transaction transaction = jedis.multi();
for (int i = 0; i < keyList.size(); i++) {
transaction.set(keyList.get(i), valueList.get(i));
}
transaction.exec();
return true;
}
});
}
Aggregations