publisher

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNonPositiveNumberOfRetries  = errors.New("number of retries should be positive")
	ErrNonPositiveTimeToFirstRetry = errors.New("time to first retry should be positive")
)

Functions

This section is empty.

Types

type ErrCouldNotPublish

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

func NewErrCouldNotPublish

func NewErrCouldNotPublish() *ErrCouldNotPublish

func (ErrCouldNotPublish) Error

func (e ErrCouldNotPublish) Error() string

func (ErrCouldNotPublish) Len

func (e ErrCouldNotPublish) Len() int

func (ErrCouldNotPublish) Reasons

func (e ErrCouldNotPublish) Reasons() map[string]error

type RetryPublisher

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

RetryPublisher is a decorator for a publisher that retries message publishing after a failure.

func NewRetryPublisher

func NewRetryPublisher(pub message.Publisher, config RetryPublisherConfig) (*RetryPublisher, error)

func (RetryPublisher) Close

func (p RetryPublisher) Close() error

func (RetryPublisher) Publish

func (p RetryPublisher) Publish(topic string, messages ...*message.Message) error

type RetryPublisherConfig

type RetryPublisherConfig struct {
	MaxRetries int
	// each subsequent retry doubles the time to next retry.
	TimeToFirstRetry time.Duration
	Logger           watermill.LoggerAdapter
}

Jump to

Keyboard shortcuts

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