Worker
class Worker (View source)
Methods
void
__construct(
QueueManager $manager,
FailedJobProviderInterface $failer = null,
Dispatcher $events = null)
Create a new queue worker.
array
daemon(
string $connectionName,
string $queue = null,
int $delay,
int $memory = 128,
int $sleep = 3,
int $maxTries)
Listen to the given queue in a loop.
array
pop(
string $connectionName,
string $queue = null,
int $delay,
int $sleep = 3,
int $maxTries)
Listen to the given queue.
array|null
bool
memoryExceeded(
int $memoryLimit)
Determine if the memory limit has been exceeded.
void
stop()
Stop listening and bail out of the script.
void
sleep(
int $seconds)
Sleep the script for a given number of seconds.
void
setDaemonExceptionHandler(
ExceptionHandler $handler)
Set the exception handler to use in Daemon mode.
void
getManager()
Get the queue manager instance.
void
Details
at line line 59
void
__construct(
QueueManager $manager,
FailedJobProviderInterface $failer = null,
Dispatcher $events = null)
Create a new queue worker.
at line line 79
array
daemon(
string $connectionName,
string $queue = null,
int $delay,
int $memory = 128,
int $sleep = 3,
int $maxTries)
Listen to the given queue in a loop.
at line line 144
array
pop(
string $connectionName,
string $queue = null,
int $delay,
int $sleep = 3,
int $maxTries)
Listen to the given queue.
at line line 195
array|null
process(
string $connection,
Job $job,
int $maxTries,
int $delay)
Process a given job from the queue.
at line line 339
bool
memoryExceeded(
int $memoryLimit)
Determine if the memory limit has been exceeded.
at line line 396
void
setDaemonExceptionHandler(
ExceptionHandler $handler)
Set the exception handler to use in Daemon mode.