Documentation
¶
Index ¶
Constants ¶
const ( DefaultHandlerTimeout = 30 * time.Second DefaultConcurrency = 50 // goroutines available to do work )
Variables ¶
Functions ¶
func DefaultRecoveryCallback ¶ added in v0.65.0
DefaultRecoveryCallback is the function that gets called by default when handlers panic
Types ¶
type Handler ¶
type Handler struct { Handle Func Concurrency int JobTimeout time.Duration QueueCapacity int64 Queue string RecoverCallback RecoveryCallback // function called when fatal handler errors occur }
Handler handles jobs on a queue
func New ¶
New creates new queue handlers for specific queues. This function is to be usued to create new Handlers for non-periodic jobs (most jobs). Use NewPeriodic to initialize handlers for periodic jobs.
func NewPeriodic ¶ added in v0.27.0
NewPeriodic creates new queue handlers for periodic jobs. Use New to initialize handlers for non-periodic jobs.
func (*Handler) WithOptions ¶
WithOptions sets one or more options on handler
type Option ¶
type Option func(w *Handler)
Option is function that sets optional configuration for Handlers
func Concurrency ¶
Concurrency configures Neoq handlers to process jobs concurrently
Default concurrency is defined by [DefaultConcurency]
func JobTimeout ¶ added in v0.8.0
JobTimeout configures handlers with a time deadline for every executed job The timeout is the amount of time that can be spent executing the handler's Func when a timeout is exceeded, the job fails and enters its retry phase
func MaxQueueCapacity ¶
MaxQueueCapacity configures Handlers to enforce a maximum capacity on the queues that it handles queues that have reached capacity cause Enqueue() to block until the queue is below capacity
func RecoverCallback ¶ added in v0.65.0
func RecoverCallback(f RecoveryCallback) Option
RecoverCallback configures the handler with a recovery function to be called when fatal errors occur in Handlers