producerconsumer

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flush

func Flush() error

func Forget

func Forget(id uint) error

func Initialize

func Initialize()

func NewProducer

func NewProducer(topicName string, channelName string, param proto.Message, retries uint32, delay zone.Duration) *producer

func Retry

func Retry(id uint) error

Types

type Consumer

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

func NewConsumer

func NewConsumer(topicName string, channelName string, paramPtr proto.Message, handler func(paramPtr proto.Message) error) *Consumer

func (*Consumer) Failed

func (c *Consumer) Failed(msg message.Message, handlerErrPtr *error)

func (*Consumer) Pop

func (c *Consumer) Pop() error

type FailedProcessor

type FailedProcessor interface {
	FailedToDatabase(topicName string, channelName string, msg *message.Message, errStr string) error
	FailedQueuer
}

type FailedQueuer

type FailedQueuer interface {
	RetryTopic() string
	RetryHash() string
	RetryChannel() string
	RetryRetries() uint32
	RetryDelay() zone.Duration
	RetryParamProtoBytes() []byte
	FailedQueueById(id uint) (failedQueuerPtr FailedQueuer, err error)
	DeleteQueueById(id uint) error
}

type Queuer

type Queuer interface {
	SupportBroadCasting() bool
	Close() (err error)
	// contains filtered or unexported methods
}

func Queue

func Queue() Queuer

Jump to

Keyboard shortcuts

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