Documentation ¶
Overview ¶
Package redis /**外部定义协程池方式队列
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Consumer ¶
type Consumer struct { Func func(b []byte) error //接收json的处理方式 Pool *ants.Pool // contains filtered or unexported fields }
func NewConsume ¶
NewConsume 新建消费者 rdb redis客户端 name 队列名称 pool 协程池 f 处理消息方法,参数为队列消息,格式为字节数组
func (*Consumer) DispatchPending ¶
DispatchPending 对超时pending进行回收 每一个pending获取一次消息(避免直接range一批因范围问题导致消息丢失)
type Producer ¶
type Producer struct { MaxLen int64 //队列长度 Approx bool //近似长度 // contains filtered or unexported fields }
func NewProducer ¶
NewProducer 新建生产者 rdb redis客户端 name 队列名称 num 控制队列长度,0标示不控制
Click to show internal directories.
Click to hide internal directories.