Example usage for org.springframework.data.redis.core BoundListOperations leftPop

List of usage examples for org.springframework.data.redis.core BoundListOperations leftPop

Introduction

In this page you can find the example usage for org.springframework.data.redis.core BoundListOperations leftPop.

Prototype

@Nullable
V leftPop();

Source Link

Document

Removes and returns first element in list stored at the bound key.

Usage

From source file:org.shareok.data.redis.job.JobQueueDaoImpl.java

@Override
public long removeJobFromQueue(String queueName) {
    try {// w  ww.j  ava2 s.com
        BoundListOperations<String, String> jobQueueOps = (BoundListOperations<String, String>) redisTemplate
                .boundListOps(queueName);
        return Long.valueOf(jobQueueOps.leftPop());
    } catch (Exception ex) {
        logger.error("Cannot pop a job from " + queueName, ex);
    }
    return -1;
}