List of usage examples for org.springframework.data.redis.connection RedisConnection sPop
@Nullable byte[] sPop(byte[] key);
From source file:com.mauersu.util.redis.DefaultSetOperations.java
public V pop(K key) { return execute(new ValueDeserializingRedisCallback(key) { protected byte[] inRedis(byte[] rawKey, RedisConnection connection) { connection.select(dbIndex);//from w w w .j av a2s . c om return connection.sPop(rawKey); } }, true); }
From source file:com.zxy.commons.cache.RedisUtils.java
/** * Remove and return a random member from set at {@code key}. * <p>/*from w ww . j av a 2s. c om*/ * See http://redis.io/commands/spop * * @param key key * @return byte[] */ public static byte[] sPop(byte[] key) { return redisTemplate.execute(new RedisCallback<byte[]>() { @Override public byte[] doInRedis(RedisConnection redis) throws DataAccessException { return redis.sPop(key); } }); }
From source file:com.zxy.commons.cache.RedisHelper.java
/** * Remove and return a random member from set at {@code key}. * <p>/*from w w w . ja v a2 s .c o m*/ * See http://redis.io/commands/spop * * @param key key * @return byte[] */ public byte[] sPop(byte[] key) { return redisTemplate.execute(new RedisCallback<byte[]>() { @Override public byte[] doInRedis(RedisConnection redis) throws DataAccessException { return redis.sPop(key); } }); }