io.vertx.redis.RedisClient.zadd()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(226)

本文整理了Java中io.vertx.redis.RedisClient.zadd方法的一些代码示例,展示了RedisClient.zadd的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RedisClient.zadd方法的具体详情如下:
包路径:io.vertx.redis.RedisClient
类名称:RedisClient
方法名:zadd

RedisClient.zadd介绍

[英]Add one or more members to a sorted set, or update its score if it already exists
[中]将一个或多个成员添加到排序集,或更新其分数(如果已存在)

代码示例

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * Add one or more members to a sorted set, or update its score if it already exists
 * @param key Key string
 * @param score Score used for sorting
 * @param member New member key
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient zadd(String key, double score, String member, Handler<AsyncResult<Long>> handler) { 
 delegate.zadd(key, score, member, handler);
 return this;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * Add one or more members to a sorted set, or update its score if it already exists
 * @param key Key string
 * @param score Score used for sorting
 * @param member New member key
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient zadd(String key, double score, String member, Handler<AsyncResult<Long>> handler) { 
 delegate.zadd(key, score, member, handler);
 return this;
}

代码示例来源:origin: org.swisspush.gateleen/gateleen-queue

@Override
public Future<Void> lockQueue(String queueName, PatternAndCircuitHash patternAndCircuitHash) {
  Future<Void> future = Future.future();
  redisClient.zadd(buildQueuesKey(patternAndCircuitHash.getCircuitHash()), System.currentTimeMillis(), queueName, event -> {
    if(event.failed()){
      future.fail(event.cause().getMessage());
      return;
    }
    future.complete();
  });
  return future;
}

代码示例来源:origin: sczyh30/vertx-kue

/**
 * Refresh ttl
 */
Future<Job> refreshTtl() {
 Future<Job> future = Future.future();
 if (this.state == JobState.ACTIVE && this.ttl > 0) {
  client.zadd(RedisHelper.getStateKey(this.state), System.currentTimeMillis() + ttl,
   this.zid, _completer(future, this));
 }
 return future;
}

代码示例来源:origin: org.swisspush/redisques

/**
 * Stores the queue name in a sorted set with the current date as score.
 *
 * @param queue   the name of the queue
 * @param handler (optional) To get informed when done.
 */
private void updateTimestamp(final String queue, Handler<AsyncResult<Long>> handler) {
  long ts = System.currentTimeMillis();
  if (log.isTraceEnabled()) {
    log.trace("RedisQues update timestamp for queue: " + queue + " to: " + ts);
  }
  redisClient.zadd(getQueuesKey(), ts, queue, handler);
}

相关文章

RedisClient类方法