All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.phantomthief.jedis.poper.JedisStringQueuePoper Maven / Gradle / Ivy

The newest version!
/**
 * 
 */
package com.github.phantomthief.jedis.poper;

import java.util.function.Function;
import java.util.function.Supplier;

import redis.clients.jedis.ShardedJedisPool;

/**
 * @author w.vela
 */
public class JedisStringQueuePoper extends AbsJedisQueuePoper {

    private static final int DEFAULT_WAIT = 2;

    public JedisStringQueuePoper(String queueKey, Supplier jedisFactory) {
        this(queueKey, jedisFactory, DEFAULT_WAIT);
    }

    /**
     * @param queueKey
     * @param jedisFactory
     * @param wait
     */
    public JedisStringQueuePoper(String queueKey, Supplier jedisFactory, int wait) {
        super(queueKey, jedisFactory, (j, k) -> j.brpop(wait, k), Function.identity());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy