nsq

package
v1.35.18 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	*nsq.Consumer
	// contains filtered or unexported fields
}

Consumer is a wrap-up class of nsq Consumer.

func NewConsumer

func NewConsumer(topic string, channel string, config *nsq.Config, opts ...Option) (*Consumer, error)

NewConsumer return a new nsq Consumer wrapped with tracing.

func (*Consumer) AddConcurrentHandlers

func (consu *Consumer) AddConcurrentHandlers(handler HandlerWithSpanContext, concurrency int)

AddConcurrentHandlers is a nsq.Consumer.AddConcurrentHandlers wrapper with tracing operations injected into the original registered handler.

func (*Consumer) AddHandler

func (consu *Consumer) AddHandler(handler HandlerWithSpanContext)

AddHandler is a nsq.Consumer.Addhandler wrapper with tracing operations injected into the original registered handler.

type HandlerWithSpanContext added in v1.35.0

type HandlerWithSpanContext func(ctx context.Context, message *nsq.Message) error

HandlerWithSpanContext is a function adapter for nsq.Consumer.AddHandler

func (HandlerWithSpanContext) HandleMessage added in v1.35.0

func (handler HandlerWithSpanContext) HandleMessage(message *nsq.Message) error

HandleMessage adapte func(*nsq.Message)error to func(ddtrace.SpanContext, *nsq.Message)error

type Option

type Option func(cfg *clientConfig)

Option represents an option that can be used to config a client.

func WithAnalyticsRate

func WithAnalyticsRate(rate float64) Option

WithAnalyticsRate enables client analytics by set sample rate.

func WithService

func WithService(service string) Option

WithService sets the given service name for the client.

type Producer

type Producer struct {
	*nsq.Producer
	// contains filtered or unexported fields
}

Producer is a wrap-up class of nsq Producer.

func NewProducer

func NewProducer(addr string, config *nsq.Config, opts ...Option) (*Producer, error)

NewProducer return a new wrapped nsq Producer that is traced with the configurable client with opts.

func (*Producer) DeferredPublish

func (prodc *Producer) DeferredPublish(topic string, delay time.Duration, body []byte) error

DeferredPublish is a nsq Producer DeferredPublish wrapper with tracing.

func (*Producer) DeferredPublishAsync

func (prodc *Producer) DeferredPublishAsync(topic string, delay time.Duration, body []byte, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error

DeferredPublishAsync is a nsq Producer DeferredPublishAsync wrapper with tracing.

func (*Producer) DeferredPublishAsyncWithContext added in v1.35.0

func (prodc *Producer) DeferredPublishAsyncWithContext(ctx context.Context, topic string, delay time.Duration, body []byte, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error

func (*Producer) DeferredPublishWithContext added in v1.35.0

func (prodc *Producer) DeferredPublishWithContext(ctx context.Context, topic string, delay time.Duration, body []byte) error

DeferredPublishWithContext starts span with given context and wrap the nsq.Producer.DeferredPublish

func (*Producer) MultiPublish

func (prodc *Producer) MultiPublish(topic string, body [][]byte) error

MultiPublish is a nsq Producer MultiPublish wrapper with tracing.

func (*Producer) MultiPublishAsync

func (prodc *Producer) MultiPublishAsync(topic string, body [][]byte, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error

MultiPublishAsync is a nsq Producer MultiPublishAsync wrapper with tracing.

func (*Producer) MultiPublishAsyncWithContext added in v1.35.0

func (prodc *Producer) MultiPublishAsyncWithContext(ctx context.Context, topic string, body [][]byte, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error

MultiPublishAsyncWithContext starts span with given context and wrap the nsq.Producer.MultiPublishAsync

func (*Producer) MultiPublishWithContext added in v1.35.0

func (prodc *Producer) MultiPublishWithContext(ctx context.Context, topic string, body [][]byte) error

MultiPublishWithContext starts span with given context and wrap the nsq.Producer.MultiPublish

func (*Producer) Publish

func (prodc *Producer) Publish(topic string, body []byte) error

Publish is a nsq.Producer.Publish wrapper with tracing.

func (*Producer) PublishAsync

func (prodc *Producer) PublishAsync(topic string, body []byte, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error

PublishAsync is a nsq Producer PublishAsync wrapper with tracing.

func (*Producer) PublishAsyncWithContext added in v1.35.0

func (prodc *Producer) PublishAsyncWithContext(ctx context.Context, topic string, body []byte, doneChan chan *nsq.ProducerTransaction, args ...interface{}) error

PublishAsyncWithContext starts span with given context and wrap the nsq.Producer.PublishAsync

func (*Producer) PublishWithContext added in v1.35.0

func (prodc *Producer) PublishWithContext(ctx context.Context, topic string, body []byte) error

PublishWithContext starts span with given context and wrap the nsq.Producer.Publish

Jump to

Keyboard shortcuts

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