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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxInFlight = 9
	MaxAttempts = 65531
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// SyncSendMsg is used to send a message to the server
	SyncSendMsg(topic string, data []byte, delay time.Duration) error
	// ConsumerMsg is used to consume messages from the server
	ConsumerMsg(topic, channel string, lookUpAddrs []string,
		handler nsq.Handler) (*nsq.Consumer, error)
	// StopProducerList is used to stop the producer list gracefully
	StopProducerList()
}

Client is interface for nsq clusters

func New

func New(nodeList []string) (Client, error)

New creates a new nsq client

type ClientNsq

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

ClientNsq is the client for nsq clusters

func (*ClientNsq) ConsumerMsg

func (s *ClientNsq) ConsumerMsg(topic, channel string,
	lookUpAddrs []string, handler nsq.Handler) (*nsq.Consumer, error)

ConsumerMsg is used to consume messages from the server

func (*ClientNsq) StopProducerList

func (s *ClientNsq) StopProducerList()

StopProducerList is used to stop the producer list gracefully

func (*ClientNsq) SyncSendMsg

func (s *ClientNsq) SyncSendMsg(topic string, data []byte, delay time.Duration) error

SyncSendMsg is used to send a message to the server

Jump to

Keyboard shortcuts

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