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

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

Introduction

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

Prototype

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

Source Link

Document

Removes and returns first element in list stored at key .

Usage

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

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

        protected byte[] inRedis(byte[] rawKey, RedisConnection connection) {
            connection.select(dbIndex);/*from  w ww  . j  a v a2 s  .  c o  m*/
            return connection.lPop(rawKey);
        }
    }, true);
}

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

/**
 * Removes and returns first element in list stored at {@code key}.
 * <p>//from  ww w.j  a v  a  2s .c om
 * See http://redis.io/commands/lpop
 * 
 * @param key key
 * @return byte[]
 */
public static byte[] lPop(byte[] key) {
    return redisTemplate.execute(new RedisCallback<byte[]>() {
        @Override
        public byte[] doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.lPop(key);
        }
    });
}

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

/**
 * Removes and returns first element in list stored at {@code key}.
 * <p>//from   w  w w .  j av a  2s  .  co m
 * See http://redis.io/commands/lpop
 * 
 * @param key key
 * @return byte[]
 */
public byte[] lPop(byte[] key) {
    return redisTemplate.execute(new RedisCallback<byte[]>() {
        @Override
        public byte[] doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.lPop(key);
        }
    });
}