Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
QueueName string `required:"true"`
MessageHandler MessageHandlerFunc `required:"true"`
DbPool *sql.DB `required:"true"`
//-- configurable fields with defaults
// PollingInterval is the number of seconds to wait between polling for new messages when none are found, default is 1 second
PollingInterval int
// VisibilityTimeout is the number of seconds a message is hidden from other consumers while being processed, default is 10 seconds
VisibilityTimeout int
// ConcurrentMsgs is the number of messages to process concurrently, default is 10
ConcurrentMsgs int
// ArchiveAfterHandle indicates whether to archive messages after they have been handled, default is false (messages are deleted)
ArchiveAfterHandle bool
// ExponentialBackoff is the number of seconds to increase the sleep time by when no messages are found, default is 0 seconds
ExponentialBackoff int
// ExponentialPollingLimit is the maximum number of seconds to sleep when no messages are found, default is 10 seconds
ExponentialPollingLimit int
// contains filtered or unexported fields
}
func (*Consumer) ArchiveMessage ¶
func (r *Consumer) ArchiveMessage(msg *PgmqMessage)
func (*Consumer) DeleteMessage ¶
func (r *Consumer) DeleteMessage(msg *PgmqMessage)
func (*Consumer) PurgeQueue ¶
func (r *Consumer) PurgeQueue(msg *PgmqMessage)
func (*Consumer) ShutdownWithWait ¶
func (r *Consumer) ShutdownWithWait()
type MessageHandlerFunc ¶
type MessageHandlerFunc func(ctx context.Context, msg *PgmqMessage)
type PgmqMessage ¶
Click to show internal directories.
Click to hide internal directories.