package jobs

import "golazy.dev/pg/addon/postgres/jobs"

Package jobs registers the PostgreSQL-backed jobs add-on for GoLazy apps.

Most applications install it from the project root:

lazy add postgres/jobs

The add-on requires and selects the base postgres add-on automatically. Applications that construct their selection manually can use:

app := lazyapp.New(lazyapp.Config{
	Addons: lazyaddon.Select(jobs.AddonID),
	Jobs: lazyapp.Jobs(lazyjobs.Config{
		Workers: 4,
	}),
})

The add-on mounts the pgjobs migrations and supplies the durable backend while preserving application-owned settings such as workers, queues, and job definitions. After lazyapp.New returns, another selected add-on can obtain the backend with:

backend, err := lazyaddon.Require(app.Addons, jobs.BackendCapability)

Constants

const AddonID

const (
	// AddonID is the stable manifest and runtime identity of the PostgreSQL
	// jobs add-on.
	AddonID = "postgres/jobs"
)

Variables

var BackendCapability

var (
	// BackendCapability publishes the selected application's PostgreSQL jobs
	// backend to other add-ons after the jobs lifecycle hook has run.
	BackendCapability = lazyaddon.DefineCapability[lazyjobs.Backend](addonRegistration, "golazy.dev/pg/postgres/jobs/backend", 1)
)

var Version

var (

	// Version is the add-on version shipped by this module release.
	Version = addonDefinition.Version
)