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

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

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

RedisClient.hincrby介绍

[英]Increment the integer value of a hash field by the given number
[中]将哈希字段的整数值递增给定的数字

代码示例

代码示例来源:origin: xenv/gushici

private void setHistoryToRedis(Message<JsonObject> message) {
  redisClient.hincrby(Key.REDIS_CLICKS_HISTORY_HASH, LocalDate.now().toString(), 1, res -> {
    if (res.failed()) {
      log.error("Fail to get data from Redis", res.cause());
    }
  });
  redisClient.hincrby(Key.REDIS_CLICKS_TOTAL_HASH, "total", 1, res -> {
    if (res.failed()) {
      log.error("Fail to get data from Redis", res.cause());
    }
  });
}

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

/**
 * Increment the integer value of a hash field by the given number
 * @param key Key string
 * @param field Field name
 * @param increment Value by which to increment
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient hincrby(String key, String field, long increment, Handler<AsyncResult<Long>> handler) { 
 delegate.hincrby(key, field, increment, handler);
 return this;
}

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

/**
 * Increment the integer value of a hash field by the given number
 * @param key Key string
 * @param field Field name
 * @param increment Value by which to increment
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient hincrby(String key, String field, long increment, Handler<AsyncResult<Long>> handler) { 
 delegate.hincrby(key, field, increment, handler);
 return this;
}

代码示例来源:origin: cescoffier/vertx-workshop

@Override
public void vote(String name, boolean plus, Handler<AsyncResult<Void>> handler) {
 redis.hincrby(name, plus ? "up" : "down", 1, hincrby -> {
  // TODO to implement
  // TODO don't forget to publish the new ratings to RECOMMENDATIONS_ADDRESS
 });
}

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

/**
 * Attempt once and save attemptAdd times to Redis backend.
 */
private Future<Job> attemptAdd() {
 Future<Job> future = Future.future();
 String key = RedisHelper.getKey("job:" + this.id);
 if (this.attempts < this.max_attempts) {
  client.hincrby(key, "attempts", 1, r -> {
   if (r.succeeded()) {
    this.attempts = r.result().intValue();
    future.complete(this);
   } else {
    this.emitError(r.cause());
    future.fail(r.cause());
   }
  });
 } else {
  future.complete(this);
 }
 return future;
}

相关文章

RedisClient类方法