QueueAdapter
abstract class QueueAdapter (View source)
Constants
| EXIT_SUCCESS |
|
| EXIT_ERROR |
|
| EXIT_MEMORY_LIMIT |
|
Properties
| protected float | $start_time | Define the start time |
|
| protected float | $processing_timeout | Define the processing timeout |
|
| protected string | $queue | Determine the default watch name |
|
| protected int | $tries | The number of working attempts |
|
| protected int | $sleep | Define the sleep time |
Methods
Make adapter configuration
Create job unserialize
Sleep the process
Update the processing timeout
Launch the worker
Determine if "async" signals are supported.
Enable async signals for the process.
Start the worker server
Determine if the timeout is reached
Kill the process.
Set job tries
Get job tries
Set sleep time
Get the queue or return the default.
Watch the queue name
Get the queue size
Flush the queue
Generate the job id
Details
abstract QueueAdapter
configure(array $config)
Make adapter configuration
abstract bool
push(QueueJob $job)
Push new job
string
serializeProducer(QueueJob $job)
Create job serialization
QueueJob
unserializeProducer(string $job)
Create job unserialize
void
sleep(int $seconds)
Sleep the process
void
updateProcessingTimeout()
Update the processing timeout
final void
work(int $timeout, int $memory)
Launch the worker
protected bool
supportsAsyncSignals()
Determine if "async" signals are supported.
protected void
listenForSignals()
Enable async signals for the process.
void
run(string|null $queue = null)
Start the worker server
protected bool
timeoutReached(int $timeout)
Determine if the timeout is reached
void
kill(int $status = 0)
Kill the process.
void
setTries(int $tries)
Set job tries
int
getTries()
Get job tries
void
setSleep(int $sleep)
Set sleep time
string
getQueue(string|null $queue = null)
Get the queue or return the default.
void
setQueue(string $queue)
Watch the queue name
int
size(string $queue)
Get the queue size
void
flush(string|null $queue = null)
Flush the queue
final protected string
generateId()
Generate the job id