redis

package
v0.0.0-...-5aac58a Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyQueue = errors.New("empty queue")

Functions

This section is empty.

Types

type Message

type Message struct {
	Id         string `json:"id"`
	WorkerName string `json:"worker_name"`
	Data       interface{}
}

type RedisBroker

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

func NewRedisBroker

func NewRedisBroker(host, port, password string) (*RedisBroker, error)

func (*RedisBroker) Ack

func (r *RedisBroker) Ack(queue string, msg *Message) error

func (*RedisBroker) Cancel

func (r *RedisBroker) Cancel(queue string, Jid string) error

func (*RedisBroker) GetCancel

func (r *RedisBroker) GetCancel(queue string) (string, error)

func (*RedisBroker) Next

func (r *RedisBroker) Next(ctx context.Context, queue string) (msg *Message, err error)

func (*RedisBroker) Send

func (r *RedisBroker) Send(queue string, msg *Message) error

type RedisClient

type RedisClient struct {
	WaitQueue   string
	WorkQueue   string
	CancelQueue string
	// contains filtered or unexported fields
}

func NewRedisClient

func NewRedisClient(host, port, password string) (*RedisClient, error)

func (*RedisClient) CancelPop

func (r *RedisClient) CancelPop(ctx context.Context, prefix string) (string, error)

func (*RedisClient) LPush

func (r *RedisClient) LPush(ctx context.Context, prefix string, values ...interface{}) error

func (*RedisClient) LRem

func (r *RedisClient) LRem(ctx context.Context, prefix string, count int64, value interface{}) error

func (*RedisClient) Push

func (r *RedisClient) Push(ctx context.Context, prefix string, values ...interface{}) error

func (*RedisClient) RPopLPush

func (r *RedisClient) RPopLPush(ctx context.Context, prefix string) (string, error)

Jump to

Keyboard shortcuts

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