nsq

package
v0.0.0-...-d5b0b98 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyConsumer

func KeyConsumer(topic, subName string) string

KeyConsumer assembly consumer key

Types

type Handler

type Handler struct {
	Topic    string
	Channel  string
	Event    *event.Event
	Consumer *go_nsq.Consumer
}

Handler is a consumer of Nsq

func (*Handler) HandleMessage

func (s *Handler) HandleMessage(msg *go_nsq.Message) error

HandleMessage processing message

type Nsq

type Nsq struct {
	NsqClient nsq.Client
	Opts      *options.Options
	Handler   *handler.Handler
	RedisPool *redigo.Pool
	// contains filtered or unexported fields
}

Nsq is a type of connector

func New

func New(opts *options.Options, c *options.NsqConfig, handler *handler.Handler) (*Nsq, error)

New creates a Nsq connector

func (*Nsq) ConsumerDelayTopic

func (s *Nsq) ConsumerDelayTopic(confInfoList []*cc.ProducerConfInfo)

ConsumerDelayTopic is the subject of the subscription latency processor

func (*Nsq) ConsumerProcessorTopic

func (s *Nsq) ConsumerProcessorTopic(confInfoList []*cc.ProcessorConfInfo)

ConsumerProcessorTopic is the topic of the subscription processor

func (*Nsq) Stop

func (s *Nsq) Stop() error

Stop stops the Nsq connector gracefully.

func (*Nsq) WatchDelayTopic

func (s *Nsq) WatchDelayTopic(c *cc.ProducerConfInfo, eventType int32) error

WatchDelayTopic watch the topic of the latency processor

func (*Nsq) WatchProcessorTopic

func (s *Nsq) WatchProcessorTopic(c *cc.ProcessorConfInfo, eventType int32) error

WatchProcessorTopic watch the topic of the processor

Jump to

Keyboard shortcuts

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