mmq

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckHandler

type AckHandler interface {
	Ack(ctx context.Context) error
}

AckHandler 统一为 AckHandler

type QCloser

type QCloser interface {
	Close(ctx context.Context) error
}

type QDelete

type QDelete interface {
	Del(ctx context.Context, topic, msgID string) error
}

type QReader

type QReader interface {
	QCloser
	// ReadMsgByGroup 读完消息后会自动提交offset
	ReadMsgByGroup(ctx context.Context, topic, groupID string, value interface{}) (context.Context, error)
	// ReadMsgByPartition ...
	ReadMsgByPartition(ctx context.Context, topic string, partition int, value interface{}) (context.Context, error)
	// FetchMsgByGroup 读完消息后不会自动提交offset,需要手动调用Handle.CommitMsg方法来提交offset
	FetchMsgByGroup(ctx context.Context, topic, groupID string, value interface{}) (context.Context, AckHandler, error)
}

type QWriter

type QWriter interface {
	QCloser

	// WriteMsg 写入消息
	WriteMsg(ctx context.Context, topic string, key string, val interface{}) (jobID string, err error)
}

type QueueModel

type QueueModel interface {
	QWriter
	QReader

	QDelete
}

Jump to

Keyboard shortcuts

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