Documentation ¶
Overview ¶
Package rq provides a simple queue abstraction that is backed by Redis.
Package rq provides a simple queue abstraction that is backed by Redis.
Package rq provides a simple queue abstraction that is backed by Redis.
Package rq provides a simple queue abstraction that is backed by Redis.
Index ¶
- func NewPool(connectString string, maxIdle int, maxActive int, idleTime time.Duration) *redis.Pool
- type ErrorDecayQueue
- type MultiQueue
- func (m *MultiQueue) HealthyQueues() (healthyQueues []*ErrorDecayQueue)
- func (m *MultiQueue) Length() (total int, err error)
- func (m *MultiQueue) Pop(timeout int) (message string, err error)
- func (m *MultiQueue) Push(value string) (err error)
- func (mq *MultiQueue) SelectHealthyQueue() (*ErrorDecayQueue, error)
- type Queue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorDecayQueue ¶
type ErrorDecayQueue struct {
// contains filtered or unexported fields
}
func NewErrorDecayQueue ¶
func NewErrorDecayQueue(server string, queueName string, pooledConnection *redis.Pool) *ErrorDecayQueue
func (*ErrorDecayQueue) IsHealthy ¶
func (e *ErrorDecayQueue) IsHealthy() (healthy bool)
func (*ErrorDecayQueue) QueueError ¶
func (e *ErrorDecayQueue) QueueError()
type MultiQueue ¶
type MultiQueue struct {
// contains filtered or unexported fields
}
func NewMultiQueue ¶
func NewMultiQueue(pools map[string]*redis.Pool, queueName string) *MultiQueue
func (*MultiQueue) HealthyQueues ¶
func (m *MultiQueue) HealthyQueues() (healthyQueues []*ErrorDecayQueue)
func (*MultiQueue) Length ¶
func (m *MultiQueue) Length() (total int, err error)
Length will return the number of items in the specified list/queue
func (*MultiQueue) Pop ¶
func (m *MultiQueue) Pop(timeout int) (message string, err error)
Pop will perform a blocking right-pop from a Redis list/queue with the supplied queueName. An error will be returned if the operation failed.
func (*MultiQueue) Push ¶
func (m *MultiQueue) Push(value string) (err error)
Push will perform a left-push onto a Redis list/queue with the supplied queueName and value. An error will be returned if the operation failed.
func (*MultiQueue) SelectHealthyQueue ¶
func (mq *MultiQueue) SelectHealthyQueue() (*ErrorDecayQueue, error)
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func QueueConnect ¶
Connect to the Redis server at the specified address and create a queue corresponding to the given key