consumer

package
v0.0.0-...-bb75541 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageConsumer

type MessageConsumer interface {
	Consume(<-chan *sqs.Message, *sync.WaitGroup)
}

MessageConsumer is an interface defining operations that a basic SQS message consumer should implement.

type MessageHandler

type MessageHandler func(<-chan *sqs.Message, *sync.WaitGroup)

MessageHandler is a handy type to make a function a message consumer.

func DecorateConsumeFn

func DecorateConsumeFn(f func(*sqs.Message) error) MessageHandler

DecorateConsumeFn is a decorator for consumer function.

It handles the WaitGroup, receives message from the input channel. The consumer just focuses on the task of consuming a SQS message. To delete a message or not, it fully depends on the consumer itself.

func (MessageHandler) Consume

func (mh MessageHandler) Consume(c <-chan *sqs.Message, wg *sync.WaitGroup)

Consume implements the MessageConsumer interface.

Jump to

Keyboard shortcuts

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