Documentation ¶
Index ¶
- type Consumer
- type HandlerWithSpanContext
- type Option
- type Producer
- func (prodc *Producer) DeferredPublish(topic string, delay time.Duration, body []byte) error
- func (prodc *Producer) DeferredPublishAsync(topic string, delay time.Duration, body []byte, ...) error
- func (prodc *Producer) DeferredPublishAsyncWithContext(ctx context.Context, topic string, delay time.Duration, body []byte, ...) error
- func (prodc *Producer) DeferredPublishWithContext(ctx context.Context, topic string, delay time.Duration, body []byte) error
- func (prodc *Producer) MultiPublish(topic string, body [][]byte) error
- func (prodc *Producer) MultiPublishAsync(topic string, body [][]byte, doneChan chan *nsq.ProducerTransaction, ...) error
- func (prodc *Producer) MultiPublishAsyncWithContext(ctx context.Context, topic string, body [][]byte, ...) error
- func (prodc *Producer) MultiPublishWithContext(ctx context.Context, topic string, body [][]byte) error
- func (prodc *Producer) Publish(topic string, body []byte) error
- func (prodc *Producer) PublishAsync(topic string, body []byte, doneChan chan *nsq.ProducerTransaction, ...) error
- func (prodc *Producer) PublishAsyncWithContext(ctx context.Context, topic string, body []byte, ...) error
- func (prodc *Producer) PublishWithContext(ctx context.Context, topic string, body []byte) error
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(spnctx ddtrace.SpanContext, 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 ¶
WithAnalyticsRate enables client analytics by set sample rate.
func WithService ¶
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 ¶
NewProducer return a new wrapped nsq Producer that is traced with the configurable client with opts.
func (*Producer) DeferredPublish ¶
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 (*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 ¶
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) 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