Example usage for org.springframework.data.redis.connection RedisConnection rPop

List of usage examples for org.springframework.data.redis.connection RedisConnection rPop

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection rPop.

Prototype

@Nullable
byte[] rPop(byte[] key);

Source Link

Document

Removes and returns last element in list stored at key .

Usage

From source file:com.mauersu.util.redis.DefaultListOperations.java

public V rightPop(K key) {
    return execute(new ValueDeserializingRedisCallback(key) {

        protected byte[] inRedis(byte[] rawKey, RedisConnection connection) {
            connection.select(dbIndex);//from w w  w  .  ja v  a 2 s .c  om
            return connection.rPop(rawKey);
        }
    }, true);
}

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Removes and returns last element in list stored at {@code key}.
 * <p>//from www .  jav a  2  s .  c  o m
 * See http://redis.io/commands/rpop
 * 
 * @param key key
 * @return byte[]
 */
public static byte[] rPop(byte[] key) {
    return redisTemplate.execute(new RedisCallback<byte[]>() {
        @Override
        public byte[] doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.rPop(key);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Removes and returns last element in list stored at {@code key}.
 * <p>/*ww w .  j  ava 2s  . com*/
 * See http://redis.io/commands/rpop
 * 
 * @param key key
 * @return byte[]
 */
public byte[] rPop(byte[] key) {
    return redisTemplate.execute(new RedisCallback<byte[]>() {
        @Override
        public byte[] doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.rPop(key);
        }
    });
}