本文整理了Java中io.vertx.redis.RedisClient.zrangebyscore
方法的一些代码示例,展示了RedisClient.zrangebyscore
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RedisClient.zrangebyscore
方法的具体详情如下:
包路径:io.vertx.redis.RedisClient
类名称:RedisClient
方法名:zrangebyscore
[英]Return a range of members in a sorted set, by score
[中]按分数返回排序集中的成员范围
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Return a range of members in a sorted set, by score
* @param key Key string
* @param min Pattern defining a minimum value
* @param max Pattern defining a maximum value
* @param options Range and limit options
* @param handler Handler for the result of this call.
* @return
*/
public io.vertx.rxjava.redis.RedisClient zrangebyscore(String key, String min, String max, RangeLimitOptions options, Handler<AsyncResult<JsonArray>> handler) {
delegate.zrangebyscore(key, min, max, options, handler);
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Return a range of members in a sorted set, by score
* @param key Key string
* @param min Pattern defining a minimum value
* @param max Pattern defining a maximum value
* @param options Range and limit options
* @param handler Handler for the result of this call.
* @return
*/
public io.vertx.rxjava.redis.RedisClient zrangebyscore(String key, String min, String max, RangeLimitOptions options, Handler<AsyncResult<JsonArray>> handler) {
delegate.zrangebyscore(key, min, max, options, handler);
return this;
}
代码示例来源:origin: sczyh30/vertx-kue
/**
* Check active job ttl.
*/
private void checkActiveJobTtl() { // TODO
int timeout = config.getInteger("job.ttl.interval", 1000);
int limit = config.getInteger("job.ttl.limit", 1000);
// need a mechanism to stop the circuit timer
vertx.setPeriodic(timeout, l -> {
client.zrangebyscore(RedisHelper.getKey("jobs:ACTIVE"), String.valueOf(100000), String.valueOf(System.currentTimeMillis()),
new RangeLimitOptions(new JsonObject().put("offset", 0).put("count", limit)), r -> {
});
});
}
代码示例来源:origin: io.vertx/vertx-lang-groovy
public static io.vertx.redis.RedisClient zrangebyscore(io.vertx.redis.RedisClient j_receiver, java.lang.String key, java.lang.String min, java.lang.String max, java.util.Map<String, Object> options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<Object>>> handler) {
io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.zrangebyscore(key,
min,
max,
options != null ? new io.vertx.redis.op.RangeLimitOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null,
handler != null ? new io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.json.JsonArray>>() {
public void handle(io.vertx.core.AsyncResult<io.vertx.core.json.JsonArray> ar) {
handler.handle(ar.map(event -> io.vertx.core.impl.ConversionHelper.fromJsonArray(event)));
}
} : null));
return j_receiver;
}
public static io.vertx.redis.RedisClient zrevrange(io.vertx.redis.RedisClient j_receiver, java.lang.String key, long start, long stop, io.vertx.redis.op.RangeOptions options, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<Object>>> handler) {
代码示例来源:origin: org.swisspush/gateleen-monitoring
final JsonArray queuesArray = new JsonArray();
long timestamp = System.currentTimeMillis() - MAX_AGE_MILLISECONDS;
redisClient.zrangebyscore(QUEUES_KEY_PREFIX, String.valueOf(timestamp), "+inf", RangeLimitOptions.NONE, reply -> {
if(reply.failed()){
String error = "Error gathering names of active queues";
代码示例来源:origin: sczyh30/vertx-kue
/**
* Check job promotion.
* Promote delayed jobs, checking every `ms`.
*/
private void checkJobPromotion() { // TODO: TO REVIEW
int timeout = config.getInteger("job.promotion.interval", 1000);
int limit = config.getInteger("job.promotion.limit", 1000);
// need a mechanism to stop the circuit timer
vertx.setPeriodic(timeout, l -> {
client.zrangebyscore(RedisHelper.getKey("jobs:DELAYED"), String.valueOf(0), String.valueOf(System.currentTimeMillis()),
new RangeLimitOptions(new JsonObject().put("offset", 0).put("count", limit)), r -> {
if (r.succeeded()) {
r.result().forEach(r1 -> {
long id = Long.parseLong(RedisHelper.stripFIFO((String) r1));
this.getJob(id).compose(jr -> jr.get().inactive())
.setHandler(jr -> {
if (jr.succeeded()) {
jr.result().emit("promotion", jr.result().getId());
} else {
jr.cause().printStackTrace();
}
});
});
} else {
r.cause().printStackTrace();
}
});
});
}
代码示例来源:origin: org.swisspush/redisques
private void getQueues(Message<JsonObject> event, boolean countOnly, Result<Optional<Pattern>, String> filterPatternResult) {
if (filterPatternResult.isErr()) {
event.reply(createErrorReply().put(ERROR_TYPE, BAD_INPUT).put(MESSAGE, filterPatternResult.getErr()));
} else {
redisClient.zrangebyscore(getQueuesKey(), String.valueOf(getMaxAgeTimestamp()), "+inf",
RangeLimitOptions.NONE, new GetQueuesHandler(event, filterPatternResult.getOk(), countOnly));
}
}
代码示例来源:origin: org.swisspush/redisques
redisClient.zrangebyscore(getQueuesKey(), "-inf", String.valueOf(limit), RangeLimitOptions.NONE, answer -> {
JsonArray queues = answer.result();
if (answer.failed() || queues == null) {
内容来源于网络,如有侵权,请联系作者删除!