nsq

package
v2.0.79 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NSQ

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

func NewNSQ

func NewNSQ(addresses []string, cfg *nsq.Config, channelPrefix string) (*NSQ, error)

NewNSQ nsq模式 只能监听一个channel

func (*NSQ) Consumer

func (e *NSQ) Consumer(ctx context.Context, name string, f queueLib.ConsumerFunc, optionFuncs ...func(*queueLib.ConsumeOptions))

Consumer 监听消费者

func (*NSQ) Publish

func (e *NSQ) Publish(ctx context.Context, message messageLib.IMessage, optionFuncs ...func(*queueLib.PublishOptions)) error

Publish 消息入生产者

func (*NSQ) RpcRequest added in v2.0.23

func (e *NSQ) RpcRequest(ctx context.Context, key string, data []byte, optionFuncs ...func(*queueLib.ClientOptions)) ([]byte, error)

func (*NSQ) Run

func (e *NSQ) Run(ctx context.Context)

func (*NSQ) Shutdown

func (e *NSQ) Shutdown(ctx context.Context)

func (NSQ) String

func (NSQ) String() string

String 字符串类型

Jump to

Keyboard shortcuts

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