queue

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QueueName is the single queue used for all AI dispatch jobs.
	QueueName = "ai-jobs"

	// Timeout is how long a message stays invisible after Receive.
	// If the consumer dies, the message reappears after this duration.
	Timeout = 5 * time.Minute

	// MaxReceive is how many times a message can be received before
	// it becomes a dead message and is no longer delivered.
	MaxReceive = 5
)

Variables

View Source
var ErrSendJob = errors.New("send job")

ErrSendJob is returned when a message cannot be enqueued.

Functions

This section is empty.

Types

type JobMessage

type JobMessage struct {
	Type         string `json:"type"`
	RepositoryID int64  `json:"repositoryId"`
	IssueID      int64  `json:"issueId"`
}

JobMessage is the payload serialized into the goqite message body.

type Queue

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

Queue wraps goqite.Queue and implements workers.JobQueue.

func NewQueue

func NewQueue(db *sql.DB) *Queue

NewQueue creates a goqite-backed job queue.

func (*Queue) Delete added in v0.18.0

func (q *Queue) Delete(ctx context.Context, id goqite.ID) error

Delete acknowledges a message, removing it from the queue.

func (*Queue) Inner

func (q *Queue) Inner() *goqite.Queue

Inner returns the underlying goqite.Queue for use by the job processor (#156).

func (*Queue) Receive added in v0.18.0

func (q *Queue) Receive(ctx context.Context) (*goqite.Message, error)

Receive dequeues the next message from the queue. Returns nil message and nil error when the queue is empty.

func (*Queue) Send

func (q *Queue) Send(ctx context.Context, jobType string, repositoryID, issueID int64) error

Send enqueues a job message for downstream processing. Implements workers.JobQueue.

Jump to

Keyboard shortcuts

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