rq

package
v0.0.0-...-c2fae12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(connectString string, maxIdle int, maxActive int, idleTime time.Duration) *redis.Pool

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

func QueueConnect(pooledConnection *redis.Pool, key string) *Queue

Connect to the Redis server at the specified address and create a queue corresponding to the given key

func (*Queue) Length

func (queue *Queue) Length() (int, error)

Length will return the number of items in the specified list/queue

func (*Queue) Pop

func (queue *Queue) Pop(timeout int) (string, error)

Pop will perform a blocking right-pop from a Redis list/queue with the supplied key. An error will be returned if the operation failed.

func (*Queue) Push

func (queue *Queue) Push(value string) error

Push will perform a left-push onto a Redis list/queue with the supplied key and value. An error will be returned if the operation failed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL