mq

package
v1.2.3-beta3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc

type HandlerFunc func(message *Message) error

func (HandlerFunc) HandlerMessage

func (h HandlerFunc) HandlerMessage(message *Message) error

HandlerMessage implements the Handler interface

type MQ

type MQ interface {
	Pub(topic string, msg any) MQ                      // Pub any message`
	MultiPub(topic string, msgs ...any) MQ             // MultiPub ...any message
	Sub(topic, channel string, handler HandlerFunc) MQ // consumer Sub func to handle your work
	Stop(topic, channel string) MQ                     // consumer Stop
	Error() error
}

MQ message platform

func NewMQ added in v1.2.2

func NewMQ(driver string, params ...any) (mq MQ)

NewMQ Sugar

func NewNSQ added in v1.2.2

func NewNSQ(producerAddr, consumerAddr string) MQ

type Message

type Message struct {
	Body      []byte
	MessageID string
}

type NSQ added in v1.2.2

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

NSQ nsq

func (*NSQ) Error added in v1.2.2

func (n *NSQ) Error() error

func (*NSQ) MultiPub added in v1.2.2

func (n *NSQ) MultiPub(topic string, msgs ...any) MQ

func (*NSQ) Pub added in v1.2.2

func (n *NSQ) Pub(topic string, msg any) MQ

func (*NSQ) Stop added in v1.2.2

func (n *NSQ) Stop(topic, channel string) MQ

func (*NSQ) Sub added in v1.2.2

func (n *NSQ) Sub(topic, channel string, handler HandlerFunc) MQ

Jump to

Keyboard shortcuts

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