Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ChannelWorker ¶
ChannelWorker is enabling configuring queues to implement client code depending on amqp.Channel. The Do function is usually invoked in a goroutine and the channel is closed when either a connection to the broker is lost or the amqpirq.Connection is closed.
func NewFixedChannelWorker ¶
func NewFixedChannelWorker(queue func(ch *amqp.Channel) (amqp.Queue, error), size int, consumer DeliveryConsumer) ChannelWorker
NewFixedChannelWorker configures fixed size number of workers on amqp.Queue declared by lambda queue
func NewFixedChannelWorkerName ¶
func NewFixedChannelWorkerName(key string, size int, consumer DeliveryConsumer) ChannelWorker
NewFixedChannelWorker configures fixed size number of workers on amqp.Queue configured using NamedReplyQueue with name key
type Connection ¶
type Connection struct { // MaxAttempts is after how many unsuccessful attempts an error // is returned MaxAttempts int // Delay is number of seconds to wait before re-attempting connection Delay uint // contains filtered or unexported fields }
Connection facilitates interruptible connectivity to RabbitMQ broker, re-attempting connects until max attempts (default unlimited) with configured delay (default 30 secods)
func Dial ¶
func Dial(url string) (*Connection, error)
Dial is a wrapper around amqp.Dial that accepts a string in the AMQP URI format and returns a new Connection over TCP using PlainAuth.
func DialConfig ¶
func DialConfig(url string, config amqp.Config) (*Connection, error)
DialConfig is a wrapper around amqp.DialConfig that accepts a string in the AMQP URI format and a configuration for the transport and connection setup, returning a new Connection.
func DialTLS ¶
func DialTLS(url string, amqps *tls.Config) (*Connection, error)
DialTLS is a wrapper around amqp.DialTLS that accepts a string in the AMQP URI format and returns a new Connection over TCP using PlainAuth.
func (*Connection) LastError ¶
func (conn *Connection) LastError() error
LastError returns last connection error (if any)
func (*Connection) Listen ¶
func (conn *Connection) Listen(worker ConnectionWorker) (err error)
type ConnectionWorker ¶
type ConnectionWorker interface {
Do(*amqp.Connection, <-chan struct{})
}
ConnectionWorker is enabling configuring channels and queues to implement client code depending on amqp.Connection to the broker. The Do function is usually invoked in a goroutine and the channel is closed when either a connection to the broker is lost or the amqpirq.Connection is closed.
func NewConnectionWorker ¶
func NewConnectionWorker(worker ChannelWorker) ConnectionWorker
NewConnectionWorker returns new ConnectionWorker with .
func NewParallelConnectionWorker ¶
func NewParallelConnectionWorker(queue func(ch *amqp.Channel) (amqp.Queue, error), size int, consumer DeliveryConsumer) (ConnectionWorker, error)
NewParallelConnectionWorker returns new ConnectionWorker with a fixed pool size for the queue configured using lambda queue. Inbound messages are processed using DeliveryConsumer consumer.
func NewParallelConnectionWorkerName ¶
func NewParallelConnectionWorkerName(key string, size int, consumer DeliveryConsumer) (ConnectionWorker, error)
NewParallelConnectionWorker returns new ConnectionWorker with a fixed pool size for the queue key configured using NamedReplyQueue. Inbound messages are processed using DeliveryConsumer consumer.
type DeliveryConsumer ¶
DeliveryConsumer is an interface for handling amqp.Delivery messages consumed from amqp.Channel on a queue
type FixedChannelWorker ¶
type FixedChannelWorker struct {
// contains filtered or unexported fields
}
FixedChannelWorker is a fixed prefetch parallel processing worker
func (FixedChannelWorker) Do ¶
func (worker FixedChannelWorker) Do(ch *amqp.Channel, done <-chan struct{})
type ParallelConnectionWorker ¶
type ParallelConnectionWorker struct {
// contains filtered or unexported fields
}
ParallelConnectionWorker is a parallel and asynchronous implementation of ConnectionWorker
func (ParallelConnectionWorker) Do ¶
func (worker ParallelConnectionWorker) Do(conn *amqp.Connection, done <-chan struct{})