Versions in this module Expand all Collapse all v1 v1.0.0 Feb 2, 2024 Changes in this version + func PreserveCompletedJobs(worker *Worker) + type BackoffError struct + func (b BackoffError) Backoff() bool + func (b BackoffError) Error() string + type Backoffer interface + Backoff func() bool + func Backoff(msg string) Backoffer + type DB interface + Exec func(string, ...interface{}) (sql.Result, error) + QueryRow func(string, ...interface{}) *sql.Row + type Durations []time.Duration + func (ds *Durations) Scan(src interface{}) error + func (ds Durations) Value() (driver.Value, error) + type Job struct + CreatedAt time.Time + Data []byte + Error null.String + ID int64 + QueueName string + RanAt null.Time + RetryWaits Durations + RunAfter time.Time + type JobOption func(*Job) + func After(t time.Time) JobOption + func RetryWaits(ds []time.Duration) JobOption + type Worker struct + StopChan chan bool + func NewWorker(db *sql.DB, options ...WorkerOption) *Worker + func (worker *Worker) EnqueueJob(queueName string, data []byte, options ...JobOption) (int, error) + func (worker *Worker) EnqueueJobInTx(tx DB, queueName string, data []byte, options ...JobOption) (int, error) + func (worker *Worker) PerformNextJob() (attempted bool, outErr error) + func (worker *Worker) RegisterQueue(queueName string, jobFunc func([]byte) error) error + func (worker *Worker) Run() error + type WorkerOption func(*Worker) + func JobPollingInterval(d time.Duration) WorkerOption + func OnStop(f func()) WorkerOption + func SetLogger(l *log.Logger) WorkerOption