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

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

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

RedisClient.sadd介绍

[英]Add a member to a set
[中]向集合中添加成员

代码示例

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

/**
 * Add a member to a set
 * @param key Key string
 * @param member Value to be added to the set
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient sadd(String key, String member, Handler<AsyncResult<Long>> handler) { 
 delegate.sadd(key, member, handler);
 return this;
}

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

/**
 * Add a member to a set
 * @param key Key string
 * @param member Value to be added to the set
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient sadd(String key, String member, Handler<AsyncResult<Long>> handler) { 
 delegate.sadd(key, member, handler);
 return this;
}

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

/**
 * Save the job to the backend.
 */
public Future<Job> save() {
 // check
 Objects.requireNonNull(this.type, "Job type cannot be null");
 if (this.id > 0)
  return update();
 Future<Job> future = Future.future();
 // generate id
 client.incr(RedisHelper.getKey("ids"), res -> {
  if (res.succeeded()) {
   this.id = res.result();
   this.zid = RedisHelper.createFIFO(id);
   String key = RedisHelper.getKey("job:" + this.id);
   // need subscribe
   if (this.delay > 0) {
    this.state = JobState.DELAYED;
   }
   client.sadd(RedisHelper.getKey("job:types"), this.type, _failure());
   this.created_at = System.currentTimeMillis();
   this.promote_at = this.created_at + this.delay;
   // save job
   client.hmset(key, this.toJson(), _completer(future, this));
  } else {
   future.fail(res.cause());
  }
 });
 return future.compose(Job::update);
}

相关文章

RedisClient类方法