mongo数据库增加是否重缓存查询数据,增加随机修改删除状态接口;redis增加-队列消息读取封装方法

This commit is contained in:
2025-12-29 14:46:39 +08:00
committed by 张斌
parent 63c19d0727
commit c80ecb19e4
3 changed files with 175 additions and 54 deletions

14
redis/message.go Normal file
View File

@@ -0,0 +1,14 @@
package redis
import "context"
type QueueMessage struct {
StreamKey string // Stream 键名
GroupName string // 消费者组名称
ConsumerName string // 消费者名称
Timeout int64 // 阻塞超时时间(毫秒)
BatchSize int64 // 最大并发数(信号量容量)
BlockMs int64
Block bool
HandleFunc func(ctx context.Context, message map[string]interface{}) error
}