Help us shape the future of Go! Take the 2026 Go Developer Survey

queue

package
v0.251.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package queue implements a quartz.JobQueue using Elasticsearch as the storage backend.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInitQueueFailed      = errors.New("could not initialize job queue")
	ErrPushJobFailed        = errors.New("push job failed")
	ErrPopJobFailed         = errors.New("pop job failed")
	ErrPopConflict          = errors.New("exhausted retries popping the head of the queue")
	ErrNoJobFound           = errors.New("no job found")
	ErrParseJobFailed       = errors.New("parsing job data failed")
	ErrGetJobFailed         = errors.New("get job failed")
	ErrRemoveJobFailed      = errors.New("remove job failed")
	ErrDeleteJobFailed      = errors.New("delete job failed")
	ErrGetJobState          = errors.New("get job state failed")
	ErrUpdateJobStateFailed = errors.New("update job state failed")
	ErrClearJobs            = errors.New("clearing jobs failed")
)

Functions

This section is empty.

Types

type JobQueue

type JobQueue struct {
	// contains filtered or unexported fields
}

JobQueue implements the quartz.JobQueue interface, using Elasticsearch as the persistence layer.

func NewJobQueue

func NewJobQueue(logger *slog.Logger) (*JobQueue, error)

NewJobQueue initializes and returns an empty jobQueue.

func (*JobQueue) Clear

func (jq *JobQueue) Clear() error

Clear clears the job queue.

func (*JobQueue) Get

func (jq *JobQueue) Get(jobKey *quartz.JobKey) (quartz.ScheduledJob, error)

Get returns the scheduled job with the specified key without removing it from the queue.

func (*JobQueue) Head

func (jq *JobQueue) Head() (quartz.ScheduledJob, error)

Head returns the first scheduled job without removing it from the queue.

func (*JobQueue) Pop

func (jq *JobQueue) Pop() (quartz.ScheduledJob, error)

Pop removes and returns the next scheduled job from the queue.

func (*JobQueue) Push

func (jq *JobQueue) Push(job quartz.ScheduledJob) error

Push inserts a new scheduled job to the queue. This method is also used by the Scheduler to reschedule existing jobs that have been dequeued for execution.

func (*JobQueue) Remove

func (jq *JobQueue) Remove(jobKey *quartz.JobKey) (quartz.ScheduledJob, error)

Remove removes and returns the scheduled job with the specified key.

func (*JobQueue) ScheduledJobs

func (jq *JobQueue) ScheduledJobs(matchers []quartz.Matcher[quartz.ScheduledJob]) ([]quartz.ScheduledJob, error)

ScheduledJobs returns the slice of all scheduled jobs in the queue.

func (*JobQueue) Size

func (jq *JobQueue) Size() (int, error)

Size returns the size of the job queue.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL