Queue
extends AbstractQueue
in package
Queue class
Tags
Table of Contents
Constants
Properties
- $adapter : AdapterInterface|TaskAdapterInterface
- Queue adapter
- $name : string
- Queue name
Methods
- __construct() : mixed
- Constructor
- adapter() : AdapterInterface|TaskAdapterInterface
- Get adapter (alias)
- addJob() : Queue
- Add job
- addJobs() : Queue
- Add jobs
- addTask() : Queue
- Add task (alias)
- addTasks() : Queue
- Add tasks
- clear() : Queue
- Clear jobs from queue
- clearFailed() : Queue
- Clear failed jobs from queue
- clearTasks() : Queue
- Clear tasks from queue
- create() : Queue
- Create the queue object
- getAdapter() : AdapterInterface|TaskAdapterInterface
- Get adapter
- getName() : string
- Get name
- getPriority() : string
- Get queue priority
- hasName() : bool
- Has name
- isFifo() : bool
- Is FIFO
- isFilo() : bool
- Is FILO
- isLifo() : bool
- Is LIFO (alias to FILO)
- isLilo() : bool
- Is LILO (alias to FIFO)
- run() : array<string|int, mixed>
- Run schedule
- setAdapter() : Queue
- Set adapter
- setName() : AbstractQueue
- Set name
- setPriority() : Queue
- Set queue priority
- work() : AbstractJob|null
- Work next job
Constants
FIFO
Queue priority constants
public
mixed
FIFO
= 'FIFO'
FILO
public
mixed
FILO
= 'FILO'
Properties
$adapter
Queue adapter
protected
AdapterInterface|TaskAdapterInterface
$adapter
$name
Queue name
protected
string
$name
Methods
__construct()
Constructor
public
__construct(string $name, AdapterInterface|TaskAdapterInterface $adapter[, string|null $priority = null ]) : mixed
Instantiate the queue object
Parameters
- $name : string
- $adapter : AdapterInterface|TaskAdapterInterface
- $priority : string|null = null
adapter()
Get adapter (alias)
public
adapter() : AdapterInterface|TaskAdapterInterface
Return values
AdapterInterface|TaskAdapterInterfaceaddJob()
Add job
public
addJob(AbstractJob $job[, int|null $maxAttempts = null ]) : Queue
Parameters
- $job : AbstractJob
- $maxAttempts : int|null = null
Return values
QueueaddJobs()
Add jobs
public
addJobs(array<string|int, mixed> $jobs[, int|null $maxAttempts = null ]) : Queue
Parameters
- $jobs : array<string|int, mixed>
- $maxAttempts : int|null = null
Return values
QueueaddTask()
Add task (alias)
public
addTask(Task $task[, int|null $maxAttempts = null ]) : Queue
Parameters
- $task : Task
- $maxAttempts : int|null = null
Tags
Return values
QueueaddTasks()
Add tasks
public
addTasks(array<string|int, mixed> $tasks[, int|null $maxAttempts = null ]) : Queue
Parameters
- $tasks : array<string|int, mixed>
- $maxAttempts : int|null = null
Tags
Return values
Queueclear()
Clear jobs from queue
public
clear() : Queue
Return values
QueueclearFailed()
Clear failed jobs from queue
public
clearFailed() : Queue
Return values
QueueclearTasks()
Clear tasks from queue
public
clearTasks() : Queue
Return values
Queuecreate()
Create the queue object
public
static create(string $name, AdapterInterface|TaskAdapterInterface $adapter[, string|null $priority = null ]) : Queue
Parameters
- $name : string
- $adapter : AdapterInterface|TaskAdapterInterface
- $priority : string|null = null
Return values
QueuegetAdapter()
Get adapter
public
getAdapter() : AdapterInterface|TaskAdapterInterface
Return values
AdapterInterface|TaskAdapterInterfacegetName()
Get name
public
getName() : string
Return values
stringgetPriority()
Get queue priority
public
getPriority() : string
Return values
stringhasName()
Has name
public
hasName() : 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
boolrun()
Run schedule
public
run([Application|null $application = null ]) : array<string|int, mixed>
Parameters
- $application : Application|null = null
Tags
Return values
array<string|int, mixed>setAdapter()
Set adapter
public
setAdapter(AdapterInterface|TaskAdapterInterface $adapter) : Queue
Parameters
- $adapter : AdapterInterface|TaskAdapterInterface
Return values
QueuesetName()
Set name
public
setName(string $name) : AbstractQueue
Parameters
- $name : string
Return values
AbstractQueuesetPriority()
Set queue priority
public
setPriority([string $priority = 'FIFO' ]) : Queue
Parameters
- $priority : string = 'FIFO'
Return values
Queuework()
Work next job
public
work([Application|null $application = null ]) : AbstractJob|null
Parameters
- $application : Application|null = null