goqueue

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: LGPL-2.1 Imports: 6 Imported by: 3

README

goqueue

Go codecov

Simple rabbitmq queue wrapper for golang.

Documentation

Index

Constants

View Source
const (
	RetryNext = iota - 3
	RetryStop
	RetryIgnore
)
View Source
const RetryHeader = "x-goqueue-retry"

Variables

This section is empty.

Functions

func Publish

func Publish(amqpCh *amqp.Channel, consumerName string, data interface{}) error

Types

type Callback

type Callback func(amqp.Delivery, *log.Entry) (Retry, error)

type Consumer

type Consumer interface {
	Consume() error
}

func NewConsumer

func NewConsumer(name string, retryIntervals []time.Duration, callback Callback, amqpConn *amqp.Connection, consumerLog *log.Entry) Consumer

type DefaultConsumer

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

func (DefaultConsumer) Consume

func (c DefaultConsumer) Consume() error

func (DefaultConsumer) ProcessDelivery

func (c DefaultConsumer) ProcessDelivery(delivery amqp.Delivery, deliveryLog *log.Entry, retry int)

type DefaultPool

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

func (DefaultPool) Start

func (p DefaultPool) Start()

type Pool

type Pool interface {
	Start()
}

func NewPool

func NewPool(queue string, workers int, retryIntervals []time.Duration, callback Callback, amqpConn *amqp.Connection, poolLog *log.Entry) Pool

type Retry

type Retry int

Directories

Path Synopsis
examples
pool Module
retry Module
single Module

Jump to

Keyboard shortcuts

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