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.
Click to show internal directories.
Click to hide internal directories.