retry

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DLQEntry

type DLQEntry struct {
	OriginalMessageID string         `json:"original_message_id"`
	CorrelationID     string         `json:"correlation_id"`
	ChannelID         string         `json:"channel_id"`
	OriginalPayload   string         `json:"original_payload,omitempty"`
	Error             string         `json:"error"`
	Destination       string         `json:"destination"`
	Timestamp         time.Time      `json:"timestamp"`
	Metadata          map[string]any `json:"metadata,omitempty"`
}

type DeadLetterQueue

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

func NewDeadLetterQueue

func NewDeadLetterQueue(cfg *config.DeadLetterConfig, send SendFunc, logger *slog.Logger) *DeadLetterQueue

func (*DeadLetterQueue) Send

func (dlq *DeadLetterQueue) Send(ctx context.Context, msg *message.Message, destination string, err error)

type DestinationQueue

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

func NewDestinationQueue

func NewDestinationQueue(name string, maxSize int, overflow string, threads int, send SendFunc, logger *slog.Logger) *DestinationQueue

func (*DestinationQueue) Depth

func (q *DestinationQueue) Depth() int

func (*DestinationQueue) Enqueue

func (q *DestinationQueue) Enqueue(ctx context.Context, msg *message.Message) error

func (*DestinationQueue) Stop

func (q *DestinationQueue) Stop()

type QueueFullError

type QueueFullError struct {
	Name string
}

func (*QueueFullError) Error

func (e *QueueFullError) Error() string

type RedisDestinationQueue

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

func NewRedisDestinationQueue

func NewRedisDestinationQueue(
	client *redis.Client,
	keyPrefix string,
	channelID string,
	name string,
	maxSize int,
	overflow string,
	threads int,
	send SendFunc,
	logger *slog.Logger,
) *RedisDestinationQueue

func (*RedisDestinationQueue) Depth

func (q *RedisDestinationQueue) Depth() int

func (*RedisDestinationQueue) Enqueue

func (q *RedisDestinationQueue) Enqueue(ctx context.Context, msg *message.Message) error

func (*RedisDestinationQueue) Stop

func (q *RedisDestinationQueue) Stop()

type Retryer

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

func NewRetryer

func NewRetryer(cfg *config.RetryConfig, logger *slog.Logger) *Retryer

func (*Retryer) Execute

func (r *Retryer) Execute(ctx context.Context, msg *message.Message, send SendFunc) (*message.Response, error)

type SendFunc

type SendFunc func(ctx context.Context, msg *message.Message) (*message.Response, error)

Jump to

Keyboard shortcuts

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