rocketqueue

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRocketQueue

func GetRocketQueue(diName string) queue.Queue

GetRocketQueue 获取 RocketQueue 实例(单例模式)

Types

type RocketMQClient

type RocketMQClient struct {
	Producer rocketmq.Producer
	Consumer rocketmq.PushConsumer
}

RocketMQClient 封装了 RocketMQ 的生产者和消费者

type RocketQueue

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

RocketQueue 实现了基于RocketMQ的队列

func (*RocketQueue) AckMsg

func (m *RocketQueue) AckMsg(ctx context.Context, key string, token string) (bool, error)

AckMsg 实现了 Queue 接口的 AckMsg 方法

func (*RocketQueue) BatchEnqueue

func (m *RocketQueue) BatchEnqueue(ctx context.Context, key string, messages []string) (bool, error)

BatchEnqueue 实现了 Queue 接口的 BatchEnqueue 方法

func (*RocketQueue) Dequeue

func (m *RocketQueue) Dequeue(ctx context.Context, key string) (message string, tag string, token string, dequeueCount int64, err error)

Dequeue 实现了 Queue 接口的 Dequeue 方法

func (*RocketQueue) Enqueue

func (m *RocketQueue) Enqueue(ctx context.Context, key string, message string) (bool, error)

Enqueue 实现了 Queue 接口的 Enqueue 方法

Jump to

Keyboard shortcuts

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