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

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

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

RedisClient.rpush介绍

[英]Append one or multiple values to a list
[中]将一个或多个值附加到列表中

代码示例

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

/**
 * Append one or multiple values to a list
 * @param key Key string
 * @param value Value to be added to the end of the list
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient rpush(String key, String value, Handler<AsyncResult<Long>> handler) { 
 delegate.rpush(key, value, handler);
 return this;
}

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

/**
 * Append one or multiple values to a list
 * @param key Key string
 * @param value Value to be added to the end of the list
 * @param handler Handler for the result of this call.
 * @return 
 */
public io.vertx.rxjava.redis.RedisClient rpush(String key, String value, Handler<AsyncResult<Long>> handler) { 
 delegate.rpush(key, value, handler);
 return this;
}

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

private void addQueueItem(Message<JsonObject> event) {
  String key1 = getQueuesPrefix() + event.body().getJsonObject(PAYLOAD).getString(QUEUENAME);
  String valueAddItem = event.body().getJsonObject(PAYLOAD).getString(BUFFER);
  redisClient.rpush(key1, valueAddItem, new AddQueueItemHandler(event));
}

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

/**
 * Log with some messages.
 */
public Future<Job> log(String msg) {
 Future<Job> future = Future.future();
 client.rpush(RedisHelper.getKey("job:" + this.id + ":log"), msg, _completer(future, this));
 return future.compose(Job::updateNow);
}

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

private void enqueue(Message<JsonObject> event) {
  updateTimestamp(event.body().getJsonObject(PAYLOAD).getString(QUEUENAME), null);
  String keyEnqueue = getQueuesPrefix() + event.body().getJsonObject(PAYLOAD).getString(QUEUENAME);
  String valueEnqueue = event.body().getString(MESSAGE);
  redisClient.rpush(keyEnqueue, valueEnqueue, event2 -> {
    JsonObject reply = new JsonObject();
    if (event2.succeeded()) {
      log.debug("RedisQues Enqueued message into queue " + event.body().getJsonObject(PAYLOAD).getString(QUEUENAME));
      notifyConsumer(event.body().getJsonObject(PAYLOAD).getString(QUEUENAME));
      reply.put(STATUS, OK);
      reply.put(MESSAGE, "enqueued");
      event.reply(reply);
    } else {
      String message = "RedisQues QUEUE_ERROR: Error while enqueueing message into queue " + event.body().getJsonObject(PAYLOAD).getString(QUEUENAME);
      log.error(message, event2.cause());
      reply.put(STATUS, ERROR);
      reply.put(MESSAGE, message);
      event.reply(reply);
    }
  });
}

相关文章

RedisClient类方法