nsqworker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Producer *nsq.Producer
)

Functions

func AddConsumer

func AddConsumer(c *nsq.Consumer)

func InitProducer

func InitProducer(config ProducerConfig)

func NewConsumer

func NewConsumer(config ConsumerConfig) *nsq.Consumer

func StopConsumers

func StopConsumers()

func StopProducer

func StopProducer()

Types

type ConsumerConfig

type ConsumerConfig struct {
	Topic      string
	Channel    string
	Address    string
	AuthSecret string
	Handler    *MessageHandler
}

type MessageHandler

type MessageHandler struct {
	Handler func(message []byte) error
}

func (*MessageHandler) HandleMessage

func (h *MessageHandler) HandleMessage(m *nsq.Message) error

type ProducerConfig

type ProducerConfig struct {
	Address    string
	AuthSecret string
}

Jump to

Keyboard shortcuts

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