queue

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IProducerConsumer

type IProducerConsumer interface {
	// Count 元素个数
	Count() int64

	// IsEmpty 集合是否为空
	IsEmpty() bool

	// Add 生产添加
	Add(value interface{}, msgId ...string) string

	// Take 消费获取一批
	Take(count int64) []redis.XMessage

	// TakeOne 消费获取一个
	TakeOne() []redis.XMessage

	// TakeOneBlock 异步消费获取一个
	TakeOneBlock(ctx context.Context, timeout int64) []redis.XMessage

	// Acknowledge 确认消费
	Acknowledge(keys ...string) int64

	// Delete 删除消费消息
	Delete(id ...string) int64
}

type QueueBase

type QueueBase struct {

	// 失败时抛出异常。默认false
	ThrowOnFailure bool

	//发送消息失败时的重试次数。默认3次
	RetryTimesWhenSendFailed int

	// 重试间隔。默认1000ms
	RetryIntervalWhenSendFailed int

	//消息队列主题
	Topic string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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