nsq

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addrs    string
	Topic    string
	Channel  string
	WarnTime time.Duration
}

type Consumer

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

func NewConsumer

func NewConsumer(ctx contextx.Context, opfs ...func(cfg *Config)) (*Consumer, error)

func (*Consumer) HandleMessage

func (c *Consumer) HandleMessage(msg *nsq.Message) error

func (*Consumer) OnMessageHandler

func (c *Consumer) OnMessageHandler(f func(data []byte))

type Producer

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

func NewProducer

func NewProducer(g contextx.Context, opfs ...func(cfg *Config)) (*Producer, error)

func (*Producer) Push

func (p *Producer) Push(data []byte) error

Jump to

Keyboard shortcuts

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