Java Code Examples for redis.clients.jedis.ShardedJedis#spop()

The following examples show how to use redis.clients.jedis.ShardedJedis#spop() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedisClientImpl.java    From nano-framework with Apache License 2.0 5 votes vote down vote up
@Override
public String spop(final String key) {
    Assert.hasText(key);
    ShardedJedis jedis = null;
    try {
        jedis = POOL.getJedis(config.getRedisType());
        return jedis.spop(key);
    } catch (final Throwable e) {
        throw new RedisClientException(e.getMessage(), e);
    } finally {
        POOL.close(jedis);
    }
}
 
Example 2
Source File: RedisClientImpl.java    From nano-framework with Apache License 2.0 5 votes vote down vote up
@Override
public Set<String> spop(final String key, final int count) {
    Assert.hasText(key);
    ShardedJedis jedis = null;
    try {
        jedis = POOL.getJedis(config.getRedisType());
        return jedis.spop(key, count);
    } catch (final Throwable e) {
        throw new RedisClientException(e.getMessage(), e);
    } finally {
        POOL.close(jedis);
    }
}