Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryQueue ¶
type MemoryQueue struct { Registry *prometheus.Registry // contains filtered or unexported fields }
MemoryQueue is an in-memory FIFO queue implementing the Queue interface
func (*MemoryQueue) Dequeue ¶
func (q *MemoryQueue) Dequeue() interface{}
Dequeue removes and returns the left most item in the queue
func (*MemoryQueue) Empty ¶
func (q *MemoryQueue) Empty() bool
Empty returns true if the queue is empty; false otherwise
func (*MemoryQueue) Enqueue ¶
func (q *MemoryQueue) Enqueue(item interface{})
Enqueue adds a new item to the queue
func (*MemoryQueue) Head ¶
func (q *MemoryQueue) Head() interface{}
Head returns the left most item in the queue but does not change the queue
func (*MemoryQueue) Size ¶
func (q *MemoryQueue) Size() int
Size returns the approximate number of elements in the queue
type Queue ¶
type Queue interface { Enqueue(interface{}) Dequeue() interface{} Size() int Empty() bool Head() interface{} Init() bool }
Queue generic queue interface
type RedisQueue ¶
type RedisQueue struct { Registry *prometheus.Registry Server string // contains filtered or unexported fields }
RedisQueue is a distributed FIFO queue using Redis
func (*RedisQueue) Dequeue ¶
func (q *RedisQueue) Dequeue() interface{}
Dequeue pop the tail off the queue and returns it
func (*RedisQueue) Empty ¶
func (q *RedisQueue) Empty() bool
Empty returns true if the queue is empty
func (*RedisQueue) Enqueue ¶
func (q *RedisQueue) Enqueue(item interface{})
Enqueue adds a new item to the queue
func (*RedisQueue) Head ¶
func (q *RedisQueue) Head() interface{}
Head returns the left most item in the queue without modifying the queue
func (*RedisQueue) Size ¶
func (q *RedisQueue) Size() int
Size returns the approximate number of elements in the queue