Examples of rpush()


Examples of org.springframework.data.redis.connection.StringRedisConnection.rPush()

    List<Object> results = redisTemplate.executePipelined(new RedisCallback() {
      public Object doInRedis(RedisConnection connection) throws DataAccessException {
        StringRedisConnection stringRedisConn = (StringRedisConnection) connection;
        stringRedisConn.set("foo", "5");
        stringRedisConn.get("foo");
        stringRedisConn.rPush("foolist", "10");
        stringRedisConn.rPush("foolist", "11");
        stringRedisConn.lRange("foolist", 0, -1);
        return null;
      }
    }, new GenericToStringSerializer<Long>(Long.class));
View Full Code Here

Examples of org.springframework.data.redis.connection.StringRedisConnection.rPush()

      public Object doInRedis(RedisConnection connection) throws DataAccessException {
        StringRedisConnection stringRedisConn = (StringRedisConnection) connection;
        stringRedisConn.set("foo", "5");
        stringRedisConn.get("foo");
        stringRedisConn.rPush("foolist", "10");
        stringRedisConn.rPush("foolist", "11");
        stringRedisConn.lRange("foolist", 0, -1);
        return null;
      }
    }, new GenericToStringSerializer<Long>(Long.class));
    assertEquals(Arrays.asList(new Object[] { 5l, 1l, 2l, Arrays.asList(new Long[] { 10l, 11l }) }), results);
View Full Code Here

Examples of redis.clients.jedis.Jedis.rpush()

    }

    // Redis List Operations
    public Long rpush(String string) {
        Jedis jedis = getResource();
        Long rpush = jedis.rpush(key(), string);
        returnResource(jedis);
        return rpush;
    }

    public String lset(int index, String value) {
View Full Code Here

Examples of redis.clients.jedis.Jedis.rpush()

        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();

            long begin = System.currentTimeMillis();
            jedis.rpush(SafeEncoder.encode(key), jsonSerialize(value));
            long end = System.currentTimeMillis();
            LOG.info("rpush key:" + key + " spends: " + (end - begin)
                    + " millionseconds.");
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
View Full Code Here

Examples of redis.clients.jedis.Jedis.rpush()

  @Override
  protected void append(ILoggingEvent event) {
    Jedis client = pool.getResource();
    try {
      String json = layout.doLayout(event);
      client.rpush(key, json);
    } catch (Exception e) {
      e.printStackTrace();
      pool.returnBrokenResource(client);
      client = null;
    } finally {
View Full Code Here

Examples of redis.clients.jedis.Jedis.rpush()

  @Override
  public void rpush(String key, String value) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      jedis.rpush(key, value);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

Examples of redis.clients.jedis.Jedis.rpush()

  @Override
  public void rpush(String key, String value) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      jedis.rpush(key, value);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

Examples of redis.clients.jedis.Jedis.rpush()

    @Override
    protected void pushWhenNoDuplicate(Request request, Task task) {
        Jedis jedis = pool.getResource();
        try {
            jedis.rpush(getQueueKey(task), request.getUrl());
            if (request.getExtras() != null) {
                String field = DigestUtils.shaHex(request.getUrl());
                String value = JSON.toJSONString(request);
                jedis.hset((ITEM_PREFIX + task.getUUID()), field, value);
            }
View Full Code Here

Examples of redis.clients.jedis.Jedis.rpush()

        final Jedis jedis = TestUtils.createJedis(config);

        // Submit a job containing incorrect JSON.
        String incorrectJson = "{";
        jedis.sadd(JesqueUtils.createKey(config.getNamespace(), QUEUES), queue);
        jedis.rpush(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue), incorrectJson);

        final Worker worker = new WorkerImpl(config, Arrays.asList(queue),
                new MapBasedJobFactory(JesqueUtils.map(JesqueUtils.entry("SleepAction", SleepAction.class))));
        final Thread workerThread = new Thread(worker);
        workerThread.start();
View Full Code Here

Examples of redis.clients.jedis.Jedis.rpush()

      public void run() {
        Jedis jedis = redisPool.getResource();
        try {
          String key = "bbb:recording:" + message.getMeetingID();
          Gson gson= new Gson();    
          jedis.rpush(key, gson.toJson(message.toMap()));
        } finally {
          redisPool.returnResource(jedis);
        }       
      }
    };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.