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

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

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

RedisClient.incrby介绍

[英]Increment the integer value of a key by the given amount
[中]将键的整数值增加给定的量

代码示例

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

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

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

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

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

@Override
public void addThenRetrieveBy(String key, Long increment, Handler<AsyncResult<Long>> resultHandler) {
 client.incrby(COUNTER_PREFIX + key, increment, ar -> {
  if (ar.succeeded()) {
   resultHandler.handle(Future.succeededFuture(ar.result()));
  } else {
   resultHandler.handle(Future.failedFuture(ar.cause()));
  }
 });
}

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

@Override
public Future<Integer> increase(String productId, int increase) {
 Future<Long> future = Future.future();
 client.incrby(PREFIX + productId, increase, future.completer());
 return future.map(Long::intValue);
}

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

private void processInternal(String type, Handler<Job> handler, boolean isWorker) {
 KueWorker worker = new KueWorker(type, handler, this);
 vertx.deployVerticle(worker, new DeploymentOptions().setWorker(isWorker), r0 -> {
  if (r0.succeeded()) {
   this.on("job_complete", msg -> {
    long dur = new Job(((JsonObject) msg.body()).getJsonObject("job")).getDuration();
    client.incrby(RedisHelper.getKey("stats:work-time"), dur, r1 -> {
     if (r1.failed())
      r1.cause().printStackTrace();
    });
   });
  }
 });
}

相关文章

微信公众号

最新文章

更多

RedisClient类方法