Documentation
¶
Index ¶
Constants ¶
const (
MaxQuantumDelta = 3 // in seconds
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct { *sync.RWMutex Processor queue.MessageProcessor // contains filtered or unexported fields }
func NewReader ¶
func NewReader(log log.Logger, cfg config.SQSReader, maxTimeNoRead *time.Duration, processor queue.MessageProcessor) (*Reader, error)
NewReader creates a new Reader with the given processor, queueARN and config.
func (*Reader) LastMessageReceived ¶
LastMessageReceived returns the time where the last message was received by the Reader. If no message was received so far it returns nil.
func (*Reader) SetMessageProcessor ¶ added in v1.1.3
func (r *Reader) SetMessageProcessor(p queue.MessageProcessor)
SetMessageProcessor sets the queue's message processor. It must be set before calling *Reader.StartReading.
func (*Reader) StartReading ¶
StartReading starts reading messages from the sqs queue. It reads messages only when there are free tokens in the message processor. It will stop reading from the queue when the passed in context is canceled. The caller can use the returned channel to track when the reader stopped reading from the queue and all the messages it is tracking are finished processing.