QueueManager
class QueueManager
Manages queue / job dispatch system.
Properties
| protected QueueDriverInterface | $driver | The driver that is being used. |
Methods
Constructor for QueueManager class.
Delete a job from the queue by its identifier.
Dispatch a new job onto the queue.
Push a raw payload onto the specified queue.
Retrieve (pop) the next available job from the specified queue.
Release a job back onto the specified queue.
Details
at line 22
__construct()
Constructor for QueueManager class.
at line 50
void
delete(mixed $jobId)
Delete a job from the queue by its identifier.
This permanently removes the job record from the underlying queue storage (e.g., deletes the row from the database or removes the entry from Redis).
at line 67
void
dispatch(string $jobClass, array $data = [], string|null $queue = null)
Dispatch a new job onto the queue.
This helper wraps push() by constructing a standard payload with the job class and data. The job class should implement a handle(array $data) method for the worker to call.
at line 91
void
push(array $payload, string $queue = 'default')
Push a raw payload onto the specified queue.
This method directly forwards the payload to the configured queue driver (database or Redis) without modification.
at line 106
array|null
pop(string $queue)
Retrieve (pop) the next available job from the specified queue.
The job is reserved by the driver (e.g., marked with a timestamp or removed from the queue in Redis) so other workers cannot process it.
at line 123
void
release(string $queue, array $payload, int $delay = 0)
Release a job back onto the specified queue.
Useful when a job has failed or needs to be retried after a delay. The payload will be re‑queued and become available again after the specified delay (if supported by the driver).