Documentation
¶
Overview ¶
Package jobworker implements the job execution engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrJobPanic is returned when a job panics during execution. ErrJobPanic = errors.New("job panicked during execution") // ErrUnknownJobType is returned when a job type is not registered in the registry. ErrUnknownJobType = errors.New("unknown job type") )
Functions ¶
This section is empty.
Types ¶
type JobWorker ¶
type JobWorker struct {
// contains filtered or unexported fields
}
JobWorker executes jobs from the queue.
func NewJobWorker ¶
func NewJobWorker( database *bun.DB, dbService db.Service, cfg *config.Config, svc *services.Registry, jobSvc jobsvc.Service, ) *JobWorker
NewJobWorker creates a new job worker.
func (*JobWorker) SetFaultLatch ¶
SetFaultLatch installs the process-wide structural-fault latch. Set by the server before Run; a worker without one never terminates the process.
type QueueDepthSampler ¶
type QueueDepthSampler struct {
// contains filtered or unexported fields
}
QueueDepthSampler periodically samples the background-job queue depth and publishes it to the solidping_jobs_queue_depth gauge. It runs one cheap COUNT(*) ... GROUP BY status query per tick and zero-fills absent statuses so a drained status drops to 0 rather than going stale.
func NewQueueDepthSampler ¶
func NewQueueDepthSampler(jobSvc jobsvc.Service) *QueueDepthSampler
NewQueueDepthSampler creates a queue-depth sampler with the default interval.
Click to show internal directories.
Click to hide internal directories.