contract

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	String() string
	PoolConfig() Pool
}

Config 配置

type Consumer

type Consumer interface {
	// QueueConsume 普通队列消费
	QueueConsume(consumer Handler) error
	// DelayQueueConsume 延时队列消费
	DelayQueueConsume(consumer Handler) error
	// Close 关闭连接
	Close() error
}

Consumer 消息消费者

type Handler

type Handler interface {
	// Handle 消费者处理器
	Handle(message message.Message) error
}

Handler 消费者接口

type Pool

type Pool struct {
	MinConn     int
	MaxConn     int
	MaxIdleConn int
	IdleTimeout time.Duration
}

type Producer

type Producer interface {
	// QueuePublish 发送普通队列消息
	QueuePublish(queueKey, messageBody string) (message.Message, error)
	// DelayQueuePublish 发送延时队列消息
	DelayQueuePublish(queueKey, messageBody string, ttl int64) (message.Message, error)
}

Producer 消息生产者

Jump to

Keyboard shortcuts

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