queue

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package queue provides build job queue interfaces and implementations.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoJobs is returned when no jobs are available in the queue.
	ErrNoJobs = errors.New("no jobs available")
	// ErrJobNotFound is returned when a job cannot be found.
	ErrJobNotFound = errors.New("job not found")
)

Common errors returned by queue operations.

Functions

This section is empty.

Types

type Queue

type Queue interface {
	// Enqueue adds a new build job to the queue.
	// The job will be serialized to JSON for storage.
	Enqueue(ctx context.Context, job *models.BuildJob) error

	// Dequeue retrieves and locks the next available build job from the queue.
	// Returns ErrNoJobs if no jobs are available.
	// The job is deserialized from JSON storage.
	Dequeue(ctx context.Context) (*models.BuildJob, error)

	// Ack acknowledges successful processing of a job, removing it from the queue.
	Ack(ctx context.Context, jobID string) error

	// Nack indicates that job processing failed, making the job available for retry.
	Nack(ctx context.Context, jobID string) error
}

Queue defines the interface for build job queue operations.

Directories

Path Synopsis
Package postgres provides a PostgreSQL-backed implementation of the build queue.
Package postgres provides a PostgreSQL-backed implementation of the build queue.

Jump to

Keyboard shortcuts

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