queue

package
v0.0.0-...-1e22931 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRouteByLatency

func WithRouteByLatency(enable bool) func(cache *RedisQueue)

func WithRouteRandomly

func WithRouteRandomly(enable bool) func(cache *RedisQueue)

Types

type RedisQueue

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

func NewRedisQueue

func NewRedisQueue(Addrs []string, opts ...redisQueueOpts) (*RedisQueue, error)

func (*RedisQueue) Close

func (r *RedisQueue) Close()

func (*RedisQueue) Pop

func (r *RedisQueue) Pop(ctx context.Context, key string) (string, error)

func (*RedisQueue) PopWait

func (r *RedisQueue) PopWait(ctx context.Context, wait time.Duration, key string) (string, []string, error)

func (*RedisQueue) Push

func (r *RedisQueue) Push(ctx context.Context, key string, values ...any) error

Push will populate a value to the left side of the queue with a given key and value

type RedisUniversalClient

type RedisUniversalClient interface {
	Ping(ctx context.Context) *redis.StatusCmd
	LPush(ctx context.Context, key string, values ...interface{}) *redis.IntCmd
	RPop(ctx context.Context, key string) *redis.StringCmd
	BLMPop(ctx context.Context, timeout time.Duration, direction string, count int64, keys ...string) *redis.KeyValuesCmd
	Close() error
}

Jump to

Keyboard shortcuts

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