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