messaging

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message[T any] interface {
	// T returns the payload of this message
	T() *T

	// Ack acknowledges successful processing of this message
	Ack() error

	// Nack indicates failure in processing this message
	Nack(err error) error
}

Message represents a message retrieved from a queue

type Queue

type Queue[T any] interface {
	// Publish adds a new message with payload to the queue
	Publish(ctx context.Context, t *T) error

	// Consume retrieves a single message from the queue
	Consume(ctx context.Context) (Message[T], error)
}

Queue represents an abstract message queue for any payload type

type QueueConfig

type QueueConfig struct {
	// MaxRetries specifies how many times a message can be retried
	MaxRetries int

	// RetryDelay specifies the time to wait before retrying a failed message
	RetryDelay int

	// VisibilityTimeout specifies how long a message is considered in-flight
	VisibilityTimeout int

	// AdditionalConfig allows implementation-specific configurations
	AdditionalConfig map[string]interface{}
}

QueueConfig defines standard configuration options for queue implementations

type Vendor

type Vendor string

Vendor represents the name of a messaging vendor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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