A redis queue that offers distributed and persistent queue
Fields inherited from class | Fields |
---|---|
class AbstractHookQueue |
started |
Constructor and description |
---|
RedisQueue
(WhoasQueueConfig queueConfig) Create the RedisQueue with valid config |
RedisQueue
() Default constructor |
Type | Name and description |
---|---|
java.lang.Long |
getSize() Return the number of elements in the queue |
void |
pop(groovy.lang.Closure action) Performs a blocking pop on the queue and invokes the closure with the item popped from the queue |
java.lang.Boolean |
push(HookRequest request) The blpop returns list of strings (key and value) |
void |
start() Setup the Redis client |
void |
stop() Setup jedis pool |
java.lang.Object |
withRedis(groovy.lang.Closure closure) Allocate redis client from the pool |
Methods inherited from class | Name |
---|---|
class AbstractHookQueue |
getSize, pop, push, start, stop |
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create the RedisQueue with valid config
Default constructor
Return the number of elements in the queue
Performs a blocking pop on the queue and invokes the closure with the item popped from the queue If the Closure throws an exception, the dequeued item will be returned to the tail end of the queue
The blpop returns list of strings (key and value)
Setup the Redis client
Setup jedis pool A single jedis instance is NOT thread-safe. JedisPool maintains a thread-safe pool of network connections. The pool will allow us to maintain a pool of multiple jedis instances and use them reliably and efficiently across different threads
Allocate redis client from the pool