本文整理了Java中io.vertx.redis.RedisClient.lpush
方法的一些代码示例,展示了RedisClient.lpush
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RedisClient.lpush
方法的具体详情如下:
包路径:io.vertx.redis.RedisClient
类名称:RedisClient
方法名:lpush
[英]Prepend one value to a list
[中]在列表前加一个值
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Prepend one value to a list
* @param key Key string
* @param value Value to be added at the beginning of the list
* @param handler Handler for the result of this call.
* @return
*/
public io.vertx.rxjava.redis.RedisClient lpush(String key, String value, Handler<AsyncResult<Long>> handler) {
delegate.lpush(key, value, handler);
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Prepend one value to a list
* @param key Key string
* @param value Value to be added at the beginning of the list
* @param handler Handler for the result of this call.
* @return
*/
public io.vertx.rxjava.redis.RedisClient lpush(String key, String value, Handler<AsyncResult<Long>> handler) {
delegate.lpush(key, value, handler);
return this;
}
代码示例来源:origin: sczyh30/vertx-kue
/**
* Get a job from Redis backend by priority.
*
* @return async result of job
*/
private Future<Optional<Job>> getJobFromBackend() {
Future<Optional<Job>> future = Future.future();
client.blpop(RedisHelper.getKey(this.type + ":jobs"), 0, r1 -> {
if (r1.failed()) {
client.lpush(RedisHelper.getKey(this.type + ":jobs"), "1", r2 -> {
if (r2.failed())
future.fail(r2.cause());
});
} else {
this.zpop(RedisHelper.getKey("jobs:" + this.type + ":INACTIVE"))
.compose(kue::getJob)
.setHandler(r -> {
if (r.succeeded()) {
future.complete(r.result());
} else
future.fail(r.cause());
});
}
});
return future;
}
内容来源于网络,如有侵权,请联系作者删除!