event

package
v1.1.45 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEvent

func NewEvent(c *conf.MQ) (mq.IMQ, error)

NewEvent 创建消息队列

Types

type RocketMQEvent

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

RocketMQEvent RocketMQ事件

func NewRocketMQEvent

func NewRocketMQEvent(c *conf.RocketMQ, opts ...RocketMQEventOption) (*RocketMQEvent, error)

NewRocketMQEvent 创建RocketMQ事件

func (*RocketMQEvent) Close

func (r *RocketMQEvent) Close()

Close 关闭 mq

func (*RocketMQEvent) ConvertMessageView

func (r *RocketMQEvent) ConvertMessageView(ctx context.Context, topic string, messages []*golang.MessageView) []*mq.Msg

ConvertMessageView 转换消息视图

func (*RocketMQEvent) Receive

func (r *RocketMQEvent) Receive(topic string) <-chan *mq.Msg

Receive 监听topic

func (*RocketMQEvent) RemoveReceiver

func (r *RocketMQEvent) RemoveReceiver(topic string)

RemoveReceiver 移除监听

func (*RocketMQEvent) Send

func (r *RocketMQEvent) Send(_ string, _ []byte) error

Send 发送消息

type RocketMQEventOption

type RocketMQEventOption func(r *RocketMQEvent)

RocketMQEventOption 选项

func WithAwaitDuration

func WithAwaitDuration(d time.Duration) RocketMQEventOption

WithAwaitDuration 设置等待时间

func WithInvisibleDuration

func WithInvisibleDuration(d time.Duration) RocketMQEventOption

WithInvisibleDuration 设置不可见时间

func WithMaxMessageNum

func WithMaxMessageNum(n int32) RocketMQEventOption

WithMaxMessageNum 设置最大消息数

Jump to

Keyboard shortcuts

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