redismq

package
v0.12.7 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqCallback

type MqCallback func(id string, data any)

回调函数

type RedisMq

type RedisMq struct {
	Prefix   string
	Group    string
	Streams  []string
	Consumer string
	// contains filtered or unexported fields
}

func NewRedisMq

func NewRedisMq(redisOption *redis.Options, prefix string, group string) *RedisMq

创建新消息队列客户端

func (*RedisMq) Add

func (t *RedisMq) Add(channel string, dataPtr any) error

data 会被 json 序列化

func (*RedisMq) Clean

func (t *RedisMq) Clean() error

清理已消费的消息 master 节点定期调用

func (*RedisMq) On

func (t *RedisMq) On(channel string, cb MqCallback, dataPtr any) error

func (*RedisMq) Start

func (t *RedisMq) Start()

启动服务

Jump to

Keyboard shortcuts

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