message

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extra

type Extra struct {
	Attributes map[string]string
	Messages   map[string]types.MessageAttributeValue
	Id         *string
	Handle     *string
}

type Handler

type Handler[T any] interface {
	// Peek 取出一个新的消息
	Peek() T

	// Process 处理消息
	Process(context context.Context, msg T, extra *Extra) (status Status, err error)
}

type Status

type Status int

Status 消费状态

const (
	// StatusUnknown 默认消费状态
	StatusUnknown Status = 0
	// StatusSuccess 消费成功,会从队列中删除消息
	StatusSuccess Status = 1
	// StatusLater 延迟消费,等待下一次消费
	StatusLater Status = 2
)

Jump to

Keyboard shortcuts

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