sp2-verify-1770324794/services/api/internal/port/job.go
rdev-worker 154c535204
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
build: /implement-feature async-jobs --requirements 'API: POST /jobs pushes ...
2026-02-05 21:04:47 +00:00

20 lines
609 B
Go

package port
import (
"context"
"git.threesix.ai/jordan/sp2-verify-1770324794/pkg/redisqueue"
)
// JobQueue defines the interface for job queue operations.
// Implementations may use Redis, PostgreSQL, or other backends.
type JobQueue interface {
// Enqueue adds a job to the queue.
// Returns the created job with ID and pending status.
Enqueue(ctx context.Context, jobType string, payload map[string]any) (*redisqueue.Job, error)
// GetJob retrieves a job by ID.
// Returns redisqueue.ErrJobNotFound if the job doesn't exist.
GetJob(ctx context.Context, jobID string) (*redisqueue.Job, error)
}