Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrMessageExpired ¶
type ErrMessageExpired struct {
// contains filtered or unexported fields
}
ErrMessageExpired is returned when a message with an expired deadline is encountered and processing is abandoned
func (ErrMessageExpired) Error ¶
func (e ErrMessageExpired) Error() string
type Middleware ¶ added in v0.2.0
type Middleware func(ProcessFunc) ProcessFunc
type ProcessFunc ¶
type ProcessFunc func(ctx context.Context, msg types.Message) ProcessResult
ProcessFunc is the signature of functions the Processor and its workers can run on received messages
type ProcessResult ¶
type ProcessResult uint8
ProcessResult is an enum used to signal success or failure when processing a message in a ProcessFunc
const ( // ProcessResultNack is the default value of ProcessResult // and indicates processing of a message failed and the // message should be re-published to the queue ProcessResultNack ProcessResult = iota // ProcessResultAck is the success variant of ProcessResult // and indicates that a message was successfully processed // and can be deleted from the queue ProcessResultAck )
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor is the struct which orchestrates polling for messages as well as starting and feeding a configured number of workers in a pool
func New ¶ added in v0.1.4
func New(c SQSClienter, config ProcessorConfig) *Processor
New returns a pointer to a new Processor given a config and sqs client
type ProcessorConfig ¶
type SQSClienter ¶
type SQSClienter interface {
ReceiveMessage(ctx context.Context, params *sqs.ReceiveMessageInput, optFns ...func(*sqs.Options)) (*sqs.ReceiveMessageOutput, error)
DeleteMessage(ctx context.Context, params *sqs.DeleteMessageInput, optFns ...func(*sqs.Options)) (*sqs.DeleteMessageOutput, error)
ChangeMessageVisibility(ctx context.Context, params *sqs.ChangeMessageVisibilityInput, optFns ...func(*sqs.Options)) (*sqs.ChangeMessageVisibilityOutput, error)
}
SQSClienter encapsulates all sqs methods a Processor will use
Click to show internal directories.
Click to hide internal directories.