queue

package
v1.15.12 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 20 Imported by: 5

Documentation

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.15.12

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

func (*Application) Failer added in v1.15.12

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

func (*Application) GetJob added in v1.15.12

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.15.12

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.15.12

func (r *Config) Debug() bool

func (*Config) DefaultConcurrent added in v1.15.12

func (r *Config) DefaultConcurrent() int

func (*Config) DefaultConnection added in v1.12.0

func (r *Config) DefaultConnection() string

func (*Config) DefaultQueue added in v1.15.12

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.15.12

func (r *Config) FailedDatabase() string

func (*Config) FailedTable added in v1.15.12

func (r *Config) FailedTable() string

func (*Config) Via added in v1.15.12

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

type Database added in v1.15.12

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

func NewDatabase added in v1.15.12

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

func (*Database) Driver added in v1.15.12

func (r *Database) Driver() string

func (*Database) Pop added in v1.15.12

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

func (*Database) Push added in v1.15.12

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

type DatabaseReservedJob added in v1.15.12

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

func NewDatabaseReservedJob added in v1.15.12

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

func (*DatabaseReservedJob) Delete added in v1.15.12

func (r *DatabaseReservedJob) Delete() error

func (*DatabaseReservedJob) Task added in v1.15.12

type DriverCreator added in v1.15.12

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

func NewDriverCreator added in v1.15.12

func (*DriverCreator) Create added in v1.15.12

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

type FailedJob added in v1.15.12

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

func NewFailedJob added in v1.15.12

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

func (*FailedJob) Connection added in v1.15.12

func (r *FailedJob) Connection() string

func (*FailedJob) FailedAt added in v1.15.12

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

func (*FailedJob) Queue added in v1.15.12

func (r *FailedJob) Queue() string

func (*FailedJob) Retry added in v1.15.12

func (r *FailedJob) Retry() error

func (*FailedJob) Signature added in v1.15.12

func (r *FailedJob) Signature() string

func (*FailedJob) UUID added in v1.15.12

func (r *FailedJob) UUID() string

type Failer added in v1.15.12

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

func NewFailer added in v1.15.12

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

func (*Failer) All added in v1.15.12

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

func (*Failer) Get added in v1.15.12

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

type JobStorer added in v1.15.12

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

func NewJobStorer added in v1.15.12

func NewJobStorer() *JobStorer

func (*JobStorer) All added in v1.15.12

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

All gets all registered jobs

func (*JobStorer) Call added in v1.15.12

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

Call calls a registered job using its signature

func (*JobStorer) Get added in v1.15.12

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

Get gets a registered job using its signature

func (*JobStorer) Register added in v1.15.12

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

Register registers jobs to the job manager

type PendingJob added in v1.15.12

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

func NewPendingChainJob added in v1.15.12

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.15.12

func (*PendingJob) Delay added in v1.15.12

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

Delay sets a delay time for the task

func (*PendingJob) Dispatch added in v1.15.12

func (r *PendingJob) Dispatch() error

Dispatch dispatches the task

func (*PendingJob) DispatchSync added in v1.15.12

func (r *PendingJob) DispatchSync() error

DispatchSync dispatches the task synchronously

func (*PendingJob) OnConnection added in v1.15.12

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

OnConnection sets the connection name

func (*PendingJob) OnQueue added in v1.15.12

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.15.12

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

type Sync added in v1.15.12

type Sync struct {
}

func NewSync added in v1.15.12

func NewSync() *Sync

func (*Sync) Driver added in v1.15.12

func (r *Sync) Driver() string

func (*Sync) Pop added in v1.15.12

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

func (*Sync) Push added in v1.15.12

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

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) Shutdown added in v1.15.12

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