queueredis

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue is the Redis based implementation of blobqueue.Queue interface

func New

func New(client *redis.Client, key string) *Queue

New returns a new Redis queue. The `key` parameter gives the key under which the queue will be stored in Redis.

func (Queue) Empty

func (q Queue) Empty() error

Empty implements `Queue` interface. It deletes all elements of the queue.

func (Queue) Len

func (q Queue) Len() (int, error)

Len implements `Queue` interface. It returns the length of the Redis list.

func (Queue) List

func (q Queue) List() (ret [][]byte, err error)

List implements `Queue` interface. It returns all the elements of the queue.

func (Queue) Pop

func (q Queue) Pop() ([]byte, error)

Pop implements `Queue` interface. It removes and returns the last elem of the Redis list.

func (Queue) Push

func (q Queue) Push(val []byte) error

Push implements `Queue` interface. It appends an item at the end of Redis list.

func (Queue) Shift

func (q Queue) Shift() ([]byte, error)

Shift implements `Queue` interface. It removes and returns the first elem of the Redis list.

func (Queue) Unshift

func (q Queue) Unshift(val []byte) error

Unshift implements `Queue` interface. It inserts an item at the beggining of Redis list.

Jump to

Keyboard shortcuts

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