redisqueue

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeadQueueInfo

type DeadQueueInfo struct {
	Stop bool
}

type HandleFunc

type HandleFunc func(stream, key, val, msgId string) error

type IQueue

type IQueue interface {
	Info() *QueueInfo
	Handle(stream, key, val, msgId string) error
}

type QueueInfo

type QueueInfo struct {
	UserQueueInfo  *UserQueueInfo
	RetryQueueInfo *RetryQueueInfo
	DeadQueueInfo  *DeadQueueInfo
	NotifyErr      func(stream, key string, err error)
	NotifyPanic    func(pnc any, stack string)
	// contains filtered or unexported fields
}

type QueueRunner

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

func NewQueueRunner

func NewQueueRunner(redisClient *redis.Client) *QueueRunner

func (*QueueRunner) CleanDead

func (qr *QueueRunner) CleanDead(ctx context.Context, stream, group string, start, batchSize int64) error

func (*QueueRunner) Close

func (qr *QueueRunner) Close() error

func (*QueueRunner) HandleDead

func (qr *QueueRunner) HandleDead(ctx context.Context, handler HandleFunc, stream, group string, ids ...string) []error

func (*QueueRunner) PageDead

func (qr *QueueRunner) PageDead(ctx context.Context, stream, group string, cursor uint64, count int64) ([]string, uint64, error)

func (*QueueRunner) Run

func (qr *QueueRunner) Run(userQueues ...IQueue) error

func (*QueueRunner) RunTrim added in v0.2.2

func (qr *QueueRunner) RunTrim(trimInfos ...*TrimInfo) error

func (*QueueRunner) Send

func (qr *QueueRunner) Send(ctx context.Context, stream, val string) (string, error)

func (*QueueRunner) SendWithKey

func (qr *QueueRunner) SendWithKey(ctx context.Context, stream, key, val string) (string, error)

type RetryQueueInfo

type RetryQueueInfo struct {
	Stop        bool
	Tick        time.Duration
	MinRetry    int64
	MinIdleTime time.Duration
	BatchSize   int64
	NotifyDead  func(stream, key, val, msgId string)
	// contains filtered or unexported fields
}

type TrimInfo added in v0.2.2

type TrimInfo struct {
	Streams     []string
	Tick        time.Duration
	MaxLen      int64
	MaxDuration time.Duration
	Limit       int64
}

type UserQueueInfo

type UserQueueInfo struct {
	Streams       []string
	Group         string
	ConsumerSize  int
	BatchSize     int64
	NewGroupStart string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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