consumer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageConsumer

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

func New

func New(config *MessageConsumerConfig, processor MessageProcessor, logger logger.Logger) (*MessageConsumer, error)

func (*MessageConsumer) Start

func (c *MessageConsumer) Start() error

func (*MessageConsumer) Stop

func (c *MessageConsumer) Stop()

type MessageConsumerConfig

type MessageConsumerConfig struct {
	NSQLookup string `mapstructure:"nsqlookup"`
	Topic     string `mapstructure:"topic"`
	Channel   string `mapstructure:"channel"`
	Prefetch  int    `mapstructure:"prefetch"`
	Workers   int    `mapstructure:"workers"`
	Attempts  uint16 `mapstructure:"attempts"`
}

MessageProducerConfig defines NSQ publish configuration

type MessageProcessor

type MessageProcessor interface {
	Process([]byte) error
}

Jump to

Keyboard shortcuts

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