Documentation ¶
Index ¶
Constants ¶
const (
DefaultHandlerTimeout = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct { Queue string Concurrency int CheckInterval time.Duration JobTimeout time.Duration Handle Func }
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 (*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 Queue handlers to process jobs concurrently the default concurrency is the number of (v)CPUs on the machine running Queue
func JobTimeout ¶
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