gue_jobs.job_id
column type changed toTEXT
and theJob.ID
field type changed fromint64
toULID
to generate ID on the client-side but keep jobs sortable by the primary key. Library is not providing any migration routines, it is up to the users to apply a migration. Example can be found at migrations/job_id_to_ulid.sql.gue_jobs.args
column type changed toBYTEA
- this allows storing any bytes as job args, not only valid JSON; library is not providing any migration routines, it is up to the users to apply a migration that may look something likeALTER TABLE gue_jobs ALTER COLUMN args TYPE bytea USING (args::text)::bytea
to change the column type and convert existing JSON records to the binary byte array representationJob.Error()
acceptserror
instance instead of error stringJob.LastError
type changed fromgithub.com/jackc/pgtype.Text
to stdlibdatabase/sql.NullString
- min tested Postgres version is
11.x
- Handler may return special typed errors to control rescheduling/discarding of the jobs on the individual basis
ErrRescheduleJobIn()
- reschedule Job after some interval from the current timeErrRescheduleJobAt()
- reschedule Job to some specific timeErrDiscardJob()
- discard a Job
- min supported go version is
1.18
- min tested Postgres version is
10.x
pgx v3
adapter is gone as it is pretty old alreadygo-pg/pg/v10
adapter is gone as it is in the maintenance mode alreadyNewClient()
returns not only client instance but an error if it fails to initNewWorker()
andNewWorkerPool()
return not only worker and pool instance but an error if fail to init- previously deprecated
Worker.Start()
andWorkerPool.Start()
removed in favour ofWorker.Run()
andWorkerPool.Run()
- please check documentation as they are slightly different Job.Priority
changed its type fromint16
toJobPriority
that is a wrapper type forint16
gue/adapter/exponential.Default
becamegue.DefaultExponentialBackoff
gue/adapter/exponential.New()
becamegue.NewExponentialBackoff()
pgx v5
adapter support- const values for
JobPriority
type to simplify usage of the common values:JobPriorityHighest
JobPriorityHigh
JobPriorityDefault
- set by default when theJob.Priority
is not explicitly setJobPriorityLow
JobPriorityLowest
WorkerPool.WorkOne
method, can be useful for testing purpose mostly- backoff implementation may return negative value to discard errored job immediately
gue.BackoffNever
backoff implementation discards the job on the first error
- OpenTelemetry Metrics are available for
Client
- useWithClientMeter()
option to set meter for the client instance. Available metrics:gue_client_enqueue
- number of job enqueue tries, exposesjob-type
andsuccess
attributesgue_client_lock_job
- number of job lock tries, exposesjob-type
andsuccess
attributes
- OpenTelemetry Metrics are available for
Worker
- useWithWorkerMeter()
orWithPoolMeter()
option to set meter for the worker instance. Available metrics:gue_worker_jobs_worked
- number of jobs process tries, exposesjob-type
andsuccess
attributesgue_worker_jobs_duration
- histogram of jobs processing duration, exposesjob-type
attribute
- OpenTelemetry Tracing is available for
Worker
- useWithWorkerTracer()
orWithPoolTracer()
option to set tracer for the worker instance GetWorkerIdx
function extracts worker index in the pool from the handler context