Database
extends AbstractTaskAdapter
in package
Database adapter class
Tags
Table of Contents
Properties
- $db : AbstractAdapter|null
- Database adapter
- $priority : string
- Queue type
- $table : string|null
- Database table
Methods
- __construct() : mixed
- Constructor
- clear() : Database
- Clear jobs out of queue
- clearFailed() : Database
- Clear failed jobs out of the queue
- clearTasks() : Database
- Clear all scheduled task
- create() : Database
- Create database adapter
- createTable() : Database
- Create the database table
- db() : AbstractAdapter|null
- Get database adapter (alias)
- getDb() : AbstractAdapter|null
- Get database adapter
- getEnd() : int
- Get queue length
- getFailedJob() : mixed
- Get failed job from worker by job ID
- getFailedJobs() : array<string|int, mixed>
- Get adapter failed jobs
- getPriority() : string
- Get queue priority
- getStart() : int
- Get queue length
- getStatus() : int
- Get queue job status
- getTable() : string|null
- Get database table
- getTask() : Task|null
- Get scheduled task
- getTaskCount() : int
- Get scheduled tasks count
- getTasks() : array<string|int, mixed>
- Get scheduled tasks
- hasFailedJob() : bool
- Check if adapter has failed job
- hasFailedJobs() : bool
- Check if adapter has failed jobs
- hasJobs() : bool
- Check if adapter has jobs
- hasTasks() : bool
- Has scheduled tasks
- isFifo() : bool
- Is FIFO
- isFilo() : bool
- Is FILO
- isLifo() : bool
- Is LIFO (alias to FILO)
- isLilo() : bool
- Is LILO (alias to FIFO)
- pop() : AbstractJob|null
- Pop job off of queue
- push() : Database
- Push job on to queue
- removeTask() : Database
- Remove scheduled task
- schedule() : Database
- Schedule job with queue
- setPriority() : AbstractAdapter
- Set queue priority
- updateTask() : Database
- Update scheduled task
Properties
$db
Database adapter
protected
AbstractAdapter|null
$db
= null
$priority
Queue type
protected
string
$priority
= 'FIFO'
$table
Database table
protected
string|null
$table
= null
Methods
__construct()
Constructor
public
__construct(AbstractAdapter $db[, string $table = 'pop_queue' ][, string|null $priority = null ]) : mixed
Instantiate the database adapter object
Parameters
- $db : AbstractAdapter
- $table : string = 'pop_queue'
- $priority : string|null = null
clear()
Clear jobs out of queue
public
clear() : Database
Return values
DatabaseclearFailed()
Clear failed jobs out of the queue
public
clearFailed() : Database
Return values
DatabaseclearTasks()
Clear all scheduled task
public
clearTasks() : Database
Return values
Databasecreate()
Create database adapter
public
static create(AbstractAdapter $db[, string $table = 'pop_queue' ][, string|null $priority = null ]) : Database
Parameters
- $db : AbstractAdapter
- $table : string = 'pop_queue'
- $priority : string|null = null
Return values
DatabasecreateTable()
Create the database table
public
createTable(string $table) : Database
Parameters
- $table : string
Return values
Databasedb()
Get database adapter (alias)
public
db() : AbstractAdapter|null
Return values
AbstractAdapter|nullgetDb()
Get database adapter
public
getDb() : AbstractAdapter|null
Return values
AbstractAdapter|nullgetEnd()
Get queue length
public
getEnd() : int
Return values
intgetFailedJob()
Get failed job from worker by job ID
public
getFailedJob(int $index[, bool $unserialize = true ]) : mixed
Parameters
- $index : int
- $unserialize : bool = true
getFailedJobs()
Get adapter failed jobs
public
getFailedJobs([bool $unserialize = true ]) : array<string|int, mixed>
Parameters
- $unserialize : bool = true
Return values
array<string|int, mixed>getPriority()
Get queue priority
public
getPriority() : string
Return values
stringgetStart()
Get queue length
public
getStart() : int
Return values
intgetStatus()
Get queue job status
public
getStatus(int $index) : int
Parameters
- $index : int
Return values
intgetTable()
Get database table
public
getTable() : string|null
Return values
string|nullgetTask()
Get scheduled task
public
getTask(string $taskId) : Task|null
Parameters
- $taskId : string
Return values
Task|nullgetTaskCount()
Get scheduled tasks count
public
getTaskCount() : int
Return values
intgetTasks()
Get scheduled tasks
public
getTasks() : array<string|int, mixed>
Return values
array<string|int, mixed>hasFailedJob()
Check if adapter has failed job
public
hasFailedJob(int $index) : bool
Parameters
- $index : int
Return values
boolhasFailedJobs()
Check if adapter has failed jobs
public
hasFailedJobs() : bool
Return values
boolhasJobs()
Check if adapter has jobs
public
hasJobs() : bool
Return values
boolhasTasks()
Has scheduled tasks
public
hasTasks() : bool
Return values
boolisFifo()
Is FIFO
public
isFifo() : bool
Return values
boolisFilo()
Is FILO
public
isFilo() : bool
Return values
boolisLifo()
Is LIFO (alias to FILO)
public
isLifo() : bool
Return values
boolisLilo()
Is LILO (alias to FIFO)
public
isLilo() : bool
Return values
boolpop()
Pop job off of queue
public
pop() : AbstractJob|null
Return values
AbstractJob|nullpush()
Push job on to queue
public
push(AbstractJob $job) : Database
Parameters
- $job : AbstractJob
Return values
DatabaseremoveTask()
Remove scheduled task
public
removeTask(string $taskId) : Database
Parameters
- $taskId : string
Return values
Databaseschedule()
Schedule job with queue
public
schedule(Task $task) : Database
Parameters
- $task : Task
Return values
DatabasesetPriority()
Set queue priority
public
setPriority([string $priority = 'FIFO' ]) : AbstractAdapter
Parameters
- $priority : string = 'FIFO'
Return values
AbstractAdapterupdateTask()
Update scheduled task
public
updateTask(Task $task) : Database
Parameters
- $task : Task