本文整理了Java中redis.clients.jedis.Transaction.rpush()
方法的一些代码示例,展示了Transaction.rpush()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transaction.rpush()
方法的具体详情如下:
包路径:redis.clients.jedis.Transaction
类名称:Transaction
方法名:rpush
暂无
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Long rPush(byte[] key, byte[]... values) {
Assert.notNull(key, "Key must not be null!");
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().rpush(key, values)));
return null;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().rpush(key, values)));
return null;
}
return connection.getJedis().rpush(key, values);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: mindwind/craft-atom
private void rpush0(String key, String... values) {
t.rpush(key, values);
}
代码示例来源:origin: com.github.biezhi/unique-support-redis
@Override
Object execute() {
Transaction transaction = jedis.getShard(key).multi();
transaction.del(key);
for (String value : values) {
transaction.rpush(key, value);
}
transaction.exec();
return null;
}
}.getResult();
代码示例来源:origin: org.springframework.data/spring-data-redis
@Override
public Long rPush(byte[] key, byte[]... values) {
Assert.notNull(key, "Key must not be null!");
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().rpush(key, values)));
return null;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().rpush(key, values)));
return null;
}
return connection.getJedis().rpush(key, values);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public Long rPush(byte[] key, byte[]... values) {
Assert.notNull(key, "Key must not be null!");
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().rpush(key, values)));
return null;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().rpush(key, values)));
return null;
}
return connection.getJedis().rpush(key, values);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: gresrun/jesque
Transaction tx = this.jedis.multi();
tx.ltrim(failQueueKey, 1, -1);
tx.rpush(failQueueKey, failMsg(thrwbl, curQueue, job));
tx.exec();
} else {
代码示例来源:origin: gresrun/jesque
/**
* {@inheritDoc}
*/
@Override
public Void doWork(final Jedis jedis) throws IOException {
jedis.incr(key(STAT, FAILED));
jedis.incr(key(STAT, FAILED, name));
final FailQueueStrategy strategy = failQueueStrategyRef.get();
final String failQueueKey = strategy.getFailQueueKey(thrwbl, job, curQueue);
if (failQueueKey != null) {
final int failQueueMaxItems = strategy.getFailQueueMaxItems(curQueue);
if (failQueueMaxItems > 0) {
Long currentItems = jedis.llen(failQueueKey);
if (currentItems >= failQueueMaxItems) {
Transaction tx = jedis.multi();
tx.ltrim(failQueueKey, 1, -1);
tx.rpush(failQueueKey, failMsg(thrwbl, curQueue, job));
tx.exec();
} else {
jedis.rpush(failQueueKey, failMsg(thrwbl, curQueue, job));
}
} else {
jedis.rpush(failQueueKey, failMsg(thrwbl, curQueue, job));
}
}
return null;
}
});
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
if (!execution.getStages().isEmpty()) {
tx.del(indexKey);
tx.rpush(indexKey, execution.getStages().stream()
.map(Stage::getId)
.toArray(String[]::new)
内容来源于网络,如有侵权,请联系作者删除!