DatabaseAdapter
class DatabaseAdapter extends QueueAdapter (View source)
Constants
| EXIT_SUCCESS |
|
| EXIT_ERROR |
|
| EXIT_MEMORY_LIMIT |
|
Properties
| protected float | $start_time | Define the start time |
from QueueAdapter |
| protected float | $processing_timeout | Define the processing timeout |
from QueueAdapter |
| protected string | $queue | Determine the default watch name |
from QueueAdapter |
| protected int | $tries | The number of working attempts |
from QueueAdapter |
| protected int | $sleep | Define the sleep time |
from QueueAdapter |
Methods
Configure Beanstalkd driver
Run the worker
Get the size of the queue.
Flush the queue table
Details
QueueAdapter
configure(array $config)
Configure Beanstalkd driver
bool
push(QueueJob $job)
Queue a 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)
Run the worker
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 = null)
Get the size of the queue.
void
flush(string|null $queue = null)
Flush the queue table
final protected string
generateId()
Generate the job id