queue

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: MIT Imports: 27 Imported by: 5

Documentation

Overview

Will be removed in v1.17

Will be removed in v1.17

Index

Constants

This section is empty.

Variables

View Source
var (
	SyncDriverName = "sync"
)

Functions

This section is empty.

Types

type Application

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

func NewApplication added in v1.7.2

func NewApplication(config queue.Config, db db.DB, job queue.JobStorer, json foundation.Json, log log.Log) *Application

func (*Application) Chain

func (r *Application) Chain(jobs []queue.ChainJob) queue.PendingJob

func (*Application) Connection added in v1.16.0

func (r *Application) Connection(name string) (queue.Driver, error)

func (*Application) Failer added in v1.16.0

func (r *Application) Failer() queue.Failer

func (*Application) GetJob added in v1.16.0

func (r *Application) GetJob(signature string) (queue.Job, error)

func (*Application) GetJobs

func (r *Application) GetJobs() []queue.Job

func (*Application) Job

func (r *Application) Job(job queue.Job, args ...[]queue.Arg) queue.PendingJob

func (*Application) JobStorer added in v1.16.0

func (r *Application) JobStorer() queue.JobStorer

func (*Application) Register

func (r *Application) Register(jobs []queue.Job)

func (*Application) Worker

func (r *Application) Worker(payloads ...queue.Args) queue.Worker

type Config added in v1.12.0

type Config struct {
	contractsconfig.Config
	// contains filtered or unexported fields
}

func NewConfig added in v1.12.0

func NewConfig(config contractsconfig.Config) *Config

func (*Config) Debug added in v1.16.0

func (r *Config) Debug() bool

func (*Config) DefaultConcurrent added in v1.16.0

func (r *Config) DefaultConcurrent() int

func (*Config) DefaultConnection added in v1.12.0

func (r *Config) DefaultConnection() string

func (*Config) DefaultQueue added in v1.16.0

func (r *Config) DefaultQueue() string

func (*Config) Driver added in v1.12.0

func (r *Config) Driver(connection string) string

func (*Config) FailedDatabase added in v1.16.0

func (r *Config) FailedDatabase() string

func (*Config) FailedTable added in v1.16.0

func (r *Config) FailedTable() string

func (*Config) Via added in v1.16.0

func (r *Config) Via(connection string) any

type Database added in v1.16.0

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

func NewDatabase added in v1.16.0

func NewDatabase(
	config contractsqueue.Config,
	db contractsdb.DB,
	jobStorer contractsqueue.JobStorer,
	json contractsfoundation.Json,
	connection string) (*Database, error)

func (*Database) Driver added in v1.16.0

func (r *Database) Driver() string

func (*Database) Pop added in v1.16.0

func (r *Database) Pop(queue string) (contractsqueue.ReservedJob, error)

func (*Database) Push added in v1.16.0

func (r *Database) Push(task contractsqueue.Task, queue string) error

type DatabaseReservedJob added in v1.16.0

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

func NewDatabaseReservedJob added in v1.16.0

func NewDatabaseReservedJob(job *models.Job, db contractsdb.DB, jobStorer contractsqueue.JobStorer, json contractsfoundation.Json, jobsTable string) (*DatabaseReservedJob, error)

func (*DatabaseReservedJob) Delete added in v1.16.0

func (r *DatabaseReservedJob) Delete() error

func (*DatabaseReservedJob) Task added in v1.16.0

type Debug added in v1.13.8

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

func NewDebug added in v1.13.8

func NewDebug(debug bool, log log.Log) *Debug

func (*Debug) Fatal added in v1.13.8

func (r *Debug) Fatal(args ...any)

func (*Debug) Fatalf added in v1.13.8

func (r *Debug) Fatalf(format string, args ...any)

func (*Debug) Fatalln added in v1.13.8

func (r *Debug) Fatalln(args ...any)

func (*Debug) Panic added in v1.13.8

func (r *Debug) Panic(args ...any)

func (*Debug) Panicf added in v1.13.8

func (r *Debug) Panicf(format string, args ...any)

func (*Debug) Panicln added in v1.13.8

func (r *Debug) Panicln(args ...any)

func (*Debug) Print added in v1.13.8

func (r *Debug) Print(args ...any)

func (*Debug) Printf added in v1.13.8

func (r *Debug) Printf(format string, args ...any)

func (*Debug) Println added in v1.13.8

func (r *Debug) Println(args ...any)

type DriverCreator added in v1.16.0

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

func NewDriverCreator added in v1.16.0

func (*DriverCreator) Create added in v1.16.0

func (r *DriverCreator) Create(connection string) (contractsqueue.Driver, error)

type Error added in v1.13.8

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

func NewError added in v1.13.8

func NewError(debug bool, log log.Log) *Error

func (*Error) Fatal added in v1.13.8

func (r *Error) Fatal(args ...any)

func (*Error) Fatalf added in v1.13.8

func (r *Error) Fatalf(format string, args ...any)

func (*Error) Fatalln added in v1.13.8

func (r *Error) Fatalln(args ...any)

func (*Error) Panic added in v1.13.8

func (r *Error) Panic(args ...any)

func (*Error) Panicf added in v1.13.8

func (r *Error) Panicf(format string, args ...any)

func (*Error) Panicln added in v1.13.8

func (r *Error) Panicln(args ...any)

func (*Error) Print added in v1.13.8

func (r *Error) Print(args ...any)

func (*Error) Printf added in v1.13.8

func (r *Error) Printf(format string, args ...any)

func (*Error) Println added in v1.13.8

func (r *Error) Println(args ...any)

type FailedJob added in v1.16.0

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

func NewFailedJob added in v1.16.0

func NewFailedJob(failedJob models.FailedJob, query db.Query, queue contractsqueue.Queue, json foundation.Json) *FailedJob

func (*FailedJob) Connection added in v1.16.0

func (r *FailedJob) Connection() string

func (*FailedJob) FailedAt added in v1.16.0

func (r *FailedJob) FailedAt() *carbon.DateTime

func (*FailedJob) Queue added in v1.16.0

func (r *FailedJob) Queue() string

func (*FailedJob) Retry added in v1.16.0

func (r *FailedJob) Retry() error

func (*FailedJob) Signature added in v1.16.0

func (r *FailedJob) Signature() string

func (*FailedJob) UUID added in v1.16.0

func (r *FailedJob) UUID() string

type Failer added in v1.16.0

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

func NewFailer added in v1.16.0

func NewFailer(config config.Config, db db.DB, queue contractsqueue.Queue, json foundation.Json) *Failer

func (*Failer) All added in v1.16.0

func (r *Failer) All() ([]contractsqueue.FailedJob, error)

func (*Failer) Get added in v1.16.0

func (r *Failer) Get(connection, queue string, uuids []string) ([]contractsqueue.FailedJob, error)

type Fatal added in v1.13.8

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

func NewFatal added in v1.13.8

func NewFatal(debug bool, log log.Log) *Fatal

func (*Fatal) Fatal added in v1.13.8

func (r *Fatal) Fatal(args ...any)

func (*Fatal) Fatalf added in v1.13.8

func (r *Fatal) Fatalf(format string, args ...any)

func (*Fatal) Fatalln added in v1.13.8

func (r *Fatal) Fatalln(args ...any)

func (*Fatal) Panic added in v1.13.8

func (r *Fatal) Panic(args ...any)

func (*Fatal) Panicf added in v1.13.8

func (r *Fatal) Panicf(format string, args ...any)

func (*Fatal) Panicln added in v1.13.8

func (r *Fatal) Panicln(args ...any)

func (*Fatal) Print added in v1.13.8

func (r *Fatal) Print(args ...any)

func (*Fatal) Printf added in v1.13.8

func (r *Fatal) Printf(format string, args ...any)

func (*Fatal) Println added in v1.13.8

func (r *Fatal) Println(args ...any)

type Info added in v1.13.8

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

func NewInfo added in v1.13.8

func NewInfo(debug bool, log log.Log) *Info

func (*Info) Fatal added in v1.13.8

func (r *Info) Fatal(args ...any)

func (*Info) Fatalf added in v1.13.8

func (r *Info) Fatalf(format string, args ...any)

func (*Info) Fatalln added in v1.13.8

func (r *Info) Fatalln(args ...any)

func (*Info) Panic added in v1.13.8

func (r *Info) Panic(args ...any)

func (*Info) Panicf added in v1.13.8

func (r *Info) Panicf(format string, args ...any)

func (*Info) Panicln added in v1.13.8

func (r *Info) Panicln(args ...any)

func (*Info) Print added in v1.13.8

func (r *Info) Print(args ...any)

func (*Info) Printf added in v1.13.8

func (r *Info) Printf(format string, args ...any)

func (*Info) Println added in v1.13.8

func (r *Info) Println(args ...any)

type JobStorer added in v1.16.0

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

func NewJobStorer added in v1.16.0

func NewJobStorer() *JobStorer

func (*JobStorer) All added in v1.16.0

func (r *JobStorer) All() []contractsqueue.Job

All gets all registered jobs

func (*JobStorer) Call added in v1.16.0

func (r *JobStorer) Call(signature string, args []any) error

Call calls a registered job using its signature

func (*JobStorer) Get added in v1.16.0

func (r *JobStorer) Get(signature string) (contractsqueue.Job, error)

Get gets a registered job using its signature

func (*JobStorer) Register added in v1.16.0

func (r *JobStorer) Register(jobs []contractsqueue.Job)

Register registers jobs to the job manager

type Machinery added in v1.12.0

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

func NewMachinery added in v1.12.0

func NewMachinery(config config.Config, log contractslog.Log, connection string) *Machinery

func (*Machinery) Driver added in v1.16.0

func (r *Machinery) Driver() string

func (*Machinery) Pop added in v1.16.0

func (r *Machinery) Pop(queue string) (contractsqueue.ReservedJob, error)

Machinery server will pop tasks automatically

func (*Machinery) Push added in v1.16.0

func (r *Machinery) Push(task contractsqueue.Task, queue string) error

func (*Machinery) Run added in v1.16.0

func (r *Machinery) Run(jobs []contractsqueue.Job, queue string, concurrent int) (*machinery.Worker, error)

func (*Machinery) Server added in v1.12.0

func (r *Machinery) Server(queue string) *machinery.Server

type PendingJob added in v1.16.0

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

func NewPendingChainJob added in v1.16.0

func NewPendingChainJob(
	config contractsqueue.Config,
	db contractsdb.DB,
	jobStorer contractsqueue.JobStorer,
	json contractsfoundation.Json,
	jobs []contractsqueue.ChainJob,
	log contractslog.Log,
) *PendingJob

func NewPendingJob added in v1.16.0

func (*PendingJob) Delay added in v1.16.0

func (r *PendingJob) Delay(delay time.Time) contractsqueue.PendingJob

Delay sets a delay time for the task

func (*PendingJob) Dispatch added in v1.16.0

func (r *PendingJob) Dispatch() error

Dispatch dispatches the task

func (*PendingJob) DispatchSync added in v1.16.0

func (r *PendingJob) DispatchSync() error

DispatchSync dispatches the task synchronously

func (*PendingJob) OnConnection added in v1.16.0

func (r *PendingJob) OnConnection(connection string) contractsqueue.PendingJob

OnConnection sets the connection name

func (*PendingJob) OnQueue added in v1.16.0

func (r *PendingJob) OnQueue(queue string) contractsqueue.PendingJob

OnQueue sets the queue name

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (r *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (r *ServiceProvider) Register(app foundation.Application)

func (*ServiceProvider) Relationship added in v1.16.0

func (r *ServiceProvider) Relationship() binding.Relationship

type Sync added in v1.16.0

type Sync struct {
}

func NewSync added in v1.16.0

func NewSync() *Sync

func (*Sync) Driver added in v1.16.0

func (r *Sync) Driver() string

func (*Sync) Pop added in v1.16.0

func (r *Sync) Pop(_ string) (queue.ReservedJob, error)

func (*Sync) Push added in v1.16.0

func (r *Sync) Push(task queue.Task, _ string) error

type Warning added in v1.13.8

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

func NewWarning added in v1.13.8

func NewWarning(debug bool, log log.Log) *Warning

func (*Warning) Fatal added in v1.13.8

func (r *Warning) Fatal(args ...any)

func (*Warning) Fatalf added in v1.13.8

func (r *Warning) Fatalf(format string, args ...any)

func (*Warning) Fatalln added in v1.13.8

func (r *Warning) Fatalln(args ...any)

func (*Warning) Panic added in v1.13.8

func (r *Warning) Panic(args ...any)

func (*Warning) Panicf added in v1.13.8

func (r *Warning) Panicf(format string, args ...any)

func (*Warning) Panicln added in v1.13.8

func (r *Warning) Panicln(args ...any)

func (*Warning) Print added in v1.13.8

func (r *Warning) Print(args ...any)

func (*Warning) Printf added in v1.13.8

func (r *Warning) Printf(format string, args ...any)

func (*Warning) Println added in v1.13.8

func (r *Warning) Println(args ...any)

type Worker added in v1.12.0

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

func NewWorker added in v1.12.0

func NewWorker(config queue.Config, db db.DB, job queue.JobStorer, json foundation.Json, log log.Log, connection, queue string, concurrent, tries int) (*Worker, error)

func (*Worker) Run added in v1.12.0

func (r *Worker) Run() error

func (*Worker) RunMachinery added in v1.16.0

func (r *Worker) RunMachinery() error

RunMachinery will be removed in v1.17

func (*Worker) Shutdown added in v1.16.0

func (r *Worker) Shutdown() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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