Documentation
¶
Index ¶
- Variables
- type Application
- func (r *Application) Chain(jobs []queue.ChainJob) queue.PendingJob
- func (r *Application) Connection(name string) (queue.Driver, error)
- func (r *Application) Failer() queue.Failer
- func (r *Application) GetJob(signature string) (queue.Job, error)
- func (r *Application) GetJobs() []queue.Job
- func (r *Application) Job(job queue.Job, args ...[]queue.Arg) queue.PendingJob
- func (r *Application) JobStorer() queue.JobStorer
- func (r *Application) Register(jobs []queue.Job)
- func (r *Application) Worker(payloads ...queue.Args) queue.Worker
- type Config
- func (r *Config) Debug() bool
- func (r *Config) DefaultConcurrent() int
- func (r *Config) DefaultConnection() string
- func (r *Config) DefaultQueue() string
- func (r *Config) Driver(connection string) string
- func (r *Config) FailedDatabase() string
- func (r *Config) FailedTable() string
- func (r *Config) Timeout(connection string) time.Duration
- func (r *Config) Via(connection string) any
- type Database
- type DatabaseReservedJob
- type DriverCreator
- type FailedJob
- type Failer
- type JobStorer
- type PendingJob
- type QueueRunner
- type ServiceProvider
- type Sync
- type Worker
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 ¶
func (*Application) Chain ¶
func (r *Application) Chain(jobs []queue.ChainJob) queue.PendingJob
func (*Application) Connection ¶
func (r *Application) Connection(name string) (queue.Driver, error)
func (*Application) Failer ¶
func (r *Application) Failer() queue.Failer
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 ¶
func (r *Application) JobStorer() queue.JobStorer
func (*Application) Register ¶
func (r *Application) Register(jobs []queue.Job)
type Config ¶
type Config struct {
contractsconfig.Config
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(config contractsconfig.Config) *Config
func (*Config) DefaultConcurrent ¶
func (*Config) DefaultConnection ¶
func (*Config) DefaultQueue ¶
func (*Config) FailedDatabase ¶
func (*Config) FailedTable ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
func NewDatabase( config contractsqueue.Config, cache contractscache.Cache, db contractsdb.DB, jobStorer contractsqueue.JobStorer, json contractsfoundation.Json, connection string) (*Database, error)
func (*Database) Pop ¶
func (r *Database) Pop(queue string) (contractsqueue.ReservedJob, error)
type DatabaseReservedJob ¶
type DatabaseReservedJob struct {
// contains filtered or unexported fields
}
func NewDatabaseReservedJob ¶
func NewDatabaseReservedJob(job *models.Job, db contractsdb.DB, jobStorer contractsqueue.JobStorer, json contractsfoundation.Json, jobsTable string) (*DatabaseReservedJob, error)
func (*DatabaseReservedJob) Attempts ¶
func (r *DatabaseReservedJob) Attempts() int
Attempts returns the current attempt count of the job row.
func (*DatabaseReservedJob) Delete ¶
func (r *DatabaseReservedJob) Delete() error
func (*DatabaseReservedJob) Release ¶
func (r *DatabaseReservedJob) Release(delay time.Duration) error
Release clears the reservation and makes the job available again after the delay. Attempts is preserved so the next pop increments it (attempt N+1). A single UPDATE keeps the row id stable, unlike Laravel's delete+re-insert.
func (*DatabaseReservedJob) Task ¶
func (r *DatabaseReservedJob) Task() contractsqueue.Task
type DriverCreator ¶
type DriverCreator struct {
// contains filtered or unexported fields
}
func NewDriverCreator ¶
func NewDriverCreator(config contractsqueue.Config, cache contractscache.Cache, db contractsdb.DB, jobStorer contractsqueue.JobStorer, json contractsfoundation.Json, log contractslog.Log) *DriverCreator
func (*DriverCreator) Create ¶
func (r *DriverCreator) Create(connection string) (contractsqueue.Driver, error)
type FailedJob ¶
type FailedJob struct {
// contains filtered or unexported fields
}
func NewFailedJob ¶
func NewFailedJob(failedJob models.FailedJob, query db.Query, queue contractsqueue.Queue, json foundation.Json) *FailedJob
func (*FailedJob) Connection ¶
type Failer ¶
type Failer struct {
// contains filtered or unexported fields
}
type JobStorer ¶
type JobStorer struct {
// contains filtered or unexported fields
}
func NewJobStorer ¶
func NewJobStorer() *JobStorer
func (*JobStorer) Get ¶
func (r *JobStorer) Get(signature string) (contractsqueue.Job, error)
Get gets a registered job using its signature
func (*JobStorer) Register ¶
func (r *JobStorer) Register(jobs []contractsqueue.Job)
Register registers jobs to the job manager
type PendingJob ¶
type PendingJob struct {
// contains filtered or unexported fields
}
func NewPendingChainJob ¶
func NewPendingChainJob( config contractsqueue.Config, cache contractscache.Cache, db contractsdb.DB, jobStorer contractsqueue.JobStorer, json contractsfoundation.Json, jobs []contractsqueue.ChainJob, log contractslog.Log, ) *PendingJob
func NewPendingJob ¶
func NewPendingJob( config contractsqueue.Config, cache contractscache.Cache, db contractsdb.DB, jobStorer contractsqueue.JobStorer, json contractsfoundation.Json, job contractsqueue.Job, log contractslog.Log, args ...[]contractsqueue.Arg) *PendingJob
func (*PendingJob) Delay ¶
func (r *PendingJob) Delay(delay time.Time) contractsqueue.PendingJob
Delay sets a delay time for the task
func (*PendingJob) DispatchSync ¶
func (r *PendingJob) DispatchSync() error
DispatchSync dispatches the task synchronously
func (*PendingJob) OnConnection ¶
func (r *PendingJob) OnConnection(connection string) contractsqueue.PendingJob
OnConnection sets the connection name
func (*PendingJob) OnQueue ¶
func (r *PendingJob) OnQueue(queue string) contractsqueue.PendingJob
OnQueue sets the single queue to which the task is dispatched.
type QueueRunner ¶
type QueueRunner struct {
// contains filtered or unexported fields
}
func NewQueueRunner ¶
func NewQueueRunner(config config.Config, queue contractsqueue.Queue) *QueueRunner
func (*QueueRunner) Run ¶
func (r *QueueRunner) Run() error
func (*QueueRunner) ShouldRun ¶
func (r *QueueRunner) ShouldRun() bool
func (*QueueRunner) Shutdown ¶
func (r *QueueRunner) Shutdown() error
func (*QueueRunner) Signature ¶
func (r *QueueRunner) Signature() string
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 ¶
func (r *ServiceProvider) Relationship() binding.Relationship
func (*ServiceProvider) Runners ¶
func (r *ServiceProvider) Runners(app foundation.Application) []foundation.Runner
Source Files
¶
Click to show internal directories.
Click to hide internal directories.