delay

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

func NewDelayConsumer

func NewDelayConsumer(url, exchangeName, queueName string, chanNumber int) (*Consumer, error)

func (*Consumer) Declare

func (c *Consumer) Declare()

Declare 队列绑定

func (*Consumer) Destroy

func (c *Consumer) Destroy()

Destroy 关闭连接

func (*Consumer) OnConnectionErrorReConnection

func (c *Consumer) OnConnectionErrorReConnection()

OnConnectionErrorReConnection 连接错误,自动重连

func (*Consumer) Received

func (c *Consumer) Received(autoAck bool, handler func(receiveData, objectType string) error)

Received 通过回调函数处理接收到的消息

type Producer

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

func NewDelayProducer

func NewDelayProducer(url, exchangeName, queueName string) (*Producer, error)

NewDelayProducer 创建一个新的 Producer 实例

func (*Producer) Close

func (p *Producer) Close()

Close 手动关闭连接

func (*Producer) OnConnectionErrorReConnection

func (p *Producer) OnConnectionErrorReConnection()

OnConnectionErrorReConnection 监听连接错误,自动重连

func (*Producer) Send

func (p *Producer) Send(data, routeKey, delay, objectType string) error

Send 发送数据,channel 复用

Jump to

Keyboard shortcuts

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