retry

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Forever = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	Retries          []Retry
	FinallyMoveToDlq bool
}

func NewPolicy

func NewPolicy(finallyMoveToDlq bool, retries ...Retry) Policy

type Publisher

type Publisher interface {
	PublishWithConfirmation(ctx context.Context, exchange string, routingKey string, msg *amqp.Publishing) error
}

type Retry

type Retry struct {
	Delay       time.Duration
	MaxAttempts int
}

func ForeverWithDelay

func ForeverWithDelay(delay time.Duration) Retry

func WithDelay

func WithDelay(delay time.Duration, maxTries int) Retry

func (Retry) QueueName

func (r Retry) QueueName(originalQueue string) string

type Retryer

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

func NewRetryer

func NewRetryer(originalQueue string, policy Policy, pub Publisher) *Retryer

func (*Retryer) Do

func (r *Retryer) Do(delivery *amqp.Delivery) error

Jump to

Keyboard shortcuts

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