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

x33g5p2x  于2022-01-31 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(240)

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

RedisClient.exists介绍

[英]Determine if a key exists
[中]确定密钥是否存在

代码示例

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

/**
 * Determine if a key exists
 * @param key Key string
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient exists(String key, Handler<AsyncResult<Long>> handler) { 
 delegate.exists(key, handler);
 return this;
}

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

/**
 * Determine if a key exists
 * @param key Key string
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient exists(String key, Handler<AsyncResult<Long>> handler) { 
 delegate.exists(key, handler);
 return this;
}

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

@Override
public JobService existsJob(long id, Handler<AsyncResult<Boolean>> handler) {
 client.exists(RedisHelper.getKey("job:" + id), r -> {
  if (r.succeeded()) {
   if (r.result() == 0)
    handler.handle(Future.succeededFuture(false));
   else
    handler.handle(Future.succeededFuture(true));
  } else {
   handler.handle(Future.failedFuture(r.cause()));
  }
 });
 return this;
}

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

private void deleteLock(Message<JsonObject> event) {
  String queueName = event.body().getJsonObject(PAYLOAD).getString(QUEUENAME);
  redisClient.exists(getQueuesPrefix() + queueName, event1 -> {
    if (event1.succeeded() && event1.result() != null && event1.result() == 1) {
      notifyConsumer(queueName);
    }
    redisClient.hdel(getLocksKey(), queueName, new DeleteLockHandler(event));
  });
}

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

log.trace("RedisQues update queue: " + key);
redisClient.exists(key, event -> {
  if (event.failed() || event.result() == null) {
    log.error("RedisQues is unable to check existence of queue " + queue, event.cause());

相关文章

RedisClient类方法