nsq

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 13 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(msg *pbf.QueueMsg))

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(msg *pbf.QueueMsg) error

func (*Producer) PushProtoMsg

func (p *Producer) PushProtoMsg(msgId int32, arg interface{}, target *pbf.Target) error

Jump to

Keyboard shortcuts

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