本文整理了Java中io.vertx.redis.RedisClient.incrby
方法的一些代码示例,展示了RedisClient.incrby
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RedisClient.incrby
方法的具体详情如下:
包路径:io.vertx.redis.RedisClient
类名称: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();
});
});
}
});
}
内容来源于网络,如有侵权,请联系作者删除!