runtime_rabbit

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRabbitPrefetch = errors.New("rabbit prefetch setting")
	ErrRabbitMessages = errors.New("rabbit messages start consume")
	ErrRabbitConsume  = errors.New("rabbit messages consume")
)
View Source
var (
	ErrRabbitConnection          = errors.New("rabbitmq connection failed")
	ErrRabbitChannel             = errors.New("rabbitmq channel failed")
	ErrRabbitQueue               = errors.New("rabbitmq queue declaration failed")
	ErrRabbitProduce             = errors.New("rabbitmq producing")
	ErrRabbitProduceNotConfirmed = errors.New("rabbitmq produce not confirmed")
	ErrRabbitConfirmMode         = errors.New("rabbitmq channel confirm mode failed")
)

Functions

func NewConsumer

func NewConsumer(configurations ...runtime.Configuration[*Consumer]) runtime.Runtime

constructor

func NewProducer

func NewProducer(configurations ...runtime.Configuration[*Producer]) task.Producer

constructor

func WithConsumerConnectionString

func WithConsumerConnectionString(connectionString string) runtime.Configuration[*Consumer]

func WithConsumerHandler

func WithConsumerHandler(handler task.Executor[structure.Bytes]) runtime.Configuration[*Consumer]

func WithConsumerName

func WithConsumerName(name string) runtime.Configuration[*Consumer]

configuration

func WithConsumerQueueDurable

func WithConsumerQueueDurable(durable bool) runtime.Configuration[*Consumer]

func WithConsumerQueueName

func WithConsumerQueueName(queueName string) runtime.Configuration[*Consumer]

func WithProducerConnectionString

func WithProducerConnectionString(connectionString string) runtime.Configuration[*Producer]

func WithProducerName

func WithProducerName(name string) runtime.Configuration[*Producer]

configuration

Types

type Consumer

type Consumer struct {
	Name             string
	ConnectionString string // amqp://guest:guest@localhost:5672/
	QueueName        string
	QueueDurable     bool
	Handler          task.Executor[structure.Bytes]
	// contains filtered or unexported fields
}

implementation

func (*Consumer) Loop

func (r *Consumer) Loop(ctx context.Context, cancel context.CancelFunc) error

func (*Consumer) Start

func (r *Consumer) Start() error

func (*Consumer) Stop

func (r *Consumer) Stop()

type Producer

type Producer struct {
	Name             string
	ConnectionString string // amqp://guest:guest@localhost:5672/
	// contains filtered or unexported fields
}

implementation

func (*Producer) Produce

func (*Producer) Start

func (p *Producer) Start() error

func (*Producer) Stop

func (p *Producer) Stop()

Jump to

Keyboard shortcuts

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