Worker
in package
implements
ArrayAccess, Countable, IteratorAggregate
Queue worker class
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
Properties
- $application : Application|null
- Application object
- $queues : array<string|int, mixed>
- Queues
Methods
- __construct() : mixed
- Constructor
- __get() : Queue|null
- Get a queue
- __isset() : bool
- Determine if a queue is registered with the worker object
- __set() : void
- Register a queue with the worker
- __unset() : void
- Unset a queue with the worker
- addQueue() : Worker
- Add queue
- addQueues() : Worker
- Add queues
- application() : Application|null
- Get the application (alias)
- clear() : Worker
- Clear jobs from queue
- clearAll() : Worker
- Clear all jobs from queues
- clearAllFailed() : Worker
- Clear all failed jobs from queues
- clearAllTasks() : Worker
- Clear all tasks from queues
- clearFailed() : Worker
- Clear failed jobs from queue
- clearTasks() : Worker
- Clear tasks from queue
- count() : int
- Return count
- create() : Worker
- Create queue worker worker
- getApplication() : Application|null
- Get the application
- getIterator() : ArrayIterator
- Get iterator
- getQueue() : Queue|null
- Get queue
- getQueues() : array<string|int, mixed>
- Get queues
- hasApplication() : bool
- Has application
- hasQueue() : bool
- Has queue
- offsetExists() : bool
- Determine if a queue is registered with the worker object
- offsetGet() : Queue|null
- Get a queue
- offsetSet() : void
- Set a queue with the worker
- offsetUnset() : void
- Unset a queue from the worker
- run() : array<string|int, mixed>
- Run next scheduled task in queue
- runAll() : array<string|int, mixed>
- Run next scheduled task across in all queues
- work() : AbstractJob|null
- Work next job in queue
- workAll() : array<string|int, mixed>
- Work next job across in all queues
Properties
$application
Application object
protected
Application|null
$application
= null
$queues
Queues
protected
array<string|int, mixed>
$queues
= []
Methods
__construct()
Constructor
public
__construct([mixed $queues = null ][, Application|null $application = null ]) : mixed
Instantiate the queue worker object.
Parameters
- $queues : mixed = null
- $application : Application|null = null
__get()
Get a queue
public
__get(string $name) : Queue|null
Parameters
- $name : string
Return values
Queue|null__isset()
Determine if a queue is registered with the worker object
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
Register a queue with the worker
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
__unset()
Unset a queue with the worker
public
__unset(string $name) : void
Parameters
- $name : string
addQueue()
Add queue
public
addQueue(Queue $queue) : Worker
Parameters
- $queue : Queue
Return values
WorkeraddQueues()
Add queues
public
addQueues(array<string|int, mixed> $queues) : Worker
Parameters
- $queues : array<string|int, mixed>
Return values
Workerapplication()
Get the application (alias)
public
application() : Application|null
Return values
Application|nullclear()
Clear jobs from queue
public
clear(string $queueName) : Worker
Parameters
- $queueName : string
Return values
WorkerclearAll()
Clear all jobs from queues
public
clearAll() : Worker
Return values
WorkerclearAllFailed()
Clear all failed jobs from queues
public
clearAllFailed() : Worker
Return values
WorkerclearAllTasks()
Clear all tasks from queues
public
clearAllTasks() : Worker
Return values
WorkerclearFailed()
Clear failed jobs from queue
public
clearFailed(string $queueName) : Worker
Parameters
- $queueName : string
Return values
WorkerclearTasks()
Clear tasks from queue
public
clearTasks(string $queueName) : Worker
Parameters
- $queueName : string
Return values
Workercount()
Return count
public
count() : int
Return values
intcreate()
Create queue worker worker
public
static create([mixed $queues = null ][, Application|null $application = null ]) : Worker
Parameters
- $queues : mixed = null
- $application : Application|null = null
Return values
WorkergetApplication()
Get the application
public
getApplication() : Application|null
Return values
Application|nullgetIterator()
Get iterator
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetQueue()
Get queue
public
getQueue(string $queue) : Queue|null
Parameters
- $queue : string
Return values
Queue|nullgetQueues()
Get queues
public
getQueues() : array<string|int, mixed>
Return values
array<string|int, mixed>hasApplication()
Has application
public
hasApplication() : bool
Return values
boolhasQueue()
Has queue
public
hasQueue(string $queue) : bool
Parameters
- $queue : string
Return values
booloffsetExists()
Determine if a queue is registered with the worker object
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
Get a queue
public
offsetGet(mixed $offset) : Queue|null
Parameters
- $offset : mixed
Return values
Queue|nulloffsetSet()
Set a queue with the worker
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
Unset a queue from the worker
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
run()
Run next scheduled task in queue
public
run(string $queueName) : array<string|int, mixed>
Parameters
- $queueName : string
Return values
array<string|int, mixed>runAll()
Run next scheduled task across in all queues
public
runAll() : array<string|int, mixed>
Return values
array<string|int, mixed>work()
Work next job in queue
public
work(string $queueName) : AbstractJob|null
Parameters
- $queueName : string
Return values
AbstractJob|nullworkAll()
Work next job across in all queues
public
workAll() : array<string|int, mixed>