qos1

package
v0.0.0-...-edd4e79 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(q *QoS1)

func WithPublishWriter

func WithPublishWriter(writer broker.PublishWriter) Option

func WithSession

func WithSession(session Session) Option

func WithSubOption

func WithSubOption(option *proto.SubOption) Option

type PublishQueue

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

func NewPublishQueue

func NewPublishQueue(writer broker.PublishWriter) *PublishQueue

func (*PublishQueue) HandlePublishAck

func (q *PublishQueue) HandlePublishAck(publishAck *packets.Puback) bool

HandlePublishAck handles the publishing ack packet. match the packet id of the ack packet with the packet id in the queue. packet id means the identifier of the packet. If the packet id of the ack packet is in the queue, it will be removed from the queue. and the retry task will be deleted. return true if the packet id is in the queue, otherwise return false.

func (*PublishQueue) WritePacket

func (q *PublishQueue) WritePacket(packet *packet.PublishMessage)

WritePacket writes the publishing packet to the publishing queue.

type QoS1

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

func NewQos1

func NewQos1(topic string, options ...Option) *QoS1

func (*QoS1) Close

func (q *QoS1) Close() error

func (*QoS1) HandlePublishAck

func (q *QoS1) HandlePublishAck(pubAck *packets.Puback)

func (*QoS1) Publish

func (q *QoS1) Publish(publish *packet.PublishMessage) error

func (*QoS1) Start

func (q *QoS1) Start(ctx context.Context)

type StoreEvent

type StoreEvent interface {
	CreateListenMessageStoreEvent(topic string, handler func(...interface{}))
	DeleteListenMessageStoreEvent(topic string, handler func(i ...interface{}))
}

Jump to

Keyboard shortcuts

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