Queue
class Queue implements Queue, ClearableQueue (View source)
Traits
Properties
| protected Job|null | $processingJob | The currently processing job. |
|
| protected string|null | $processingQueue | The queue for the currently processing job. |
|
| protected CarbonImmutable | $processingJobStartedAt | The date the last job started processing. |
Methods
Forward a method call to the given object.
Forward a method call to the given object, returning $this if the forwarded call returned itself.
Throw a bad method call exception for the given method.
Create a new Queue instance.
Get the size of the queue.
Get the number of pending jobs.
Get the number of delayed jobs.
Get the number of reserved jobs.
Get the number of jobs across every managed queue.
Get the number of pending jobs across every managed queue.
Get the number of delayed jobs across every managed queue.
Get the number of reserved jobs across every managed queue.
Get the pending jobs for the given queue.
Get the delayed jobs for the given queue.
Get the reserved jobs for the given queue.
Get all pending jobs across every queue.
Get all delayed jobs across every queue.
Get all reserved jobs across every queue.
Get the creation timestamp of the oldest pending job, excluding delayed jobs.
Push a new job onto the queue.
Push a new job onto the queue.
Push a raw payload onto the queue.
Push a new job onto the queue after (n) seconds.
Push a new job onto a specific queue after (n) seconds.
Push an array of jobs onto the queue.
Long-poll the cloud-agent's runtime socket and wrap the next message in a CloudJob.
Long-poll the agent's runtime socket (GET /next) for the next job.
Report a job's terminal outcome back to the agent (POST /result).
Get a pending HTTP request bound to the agent's Unix runtime socket.
Delete all of the jobs from the queue.
Determine whether the next job should be received from the in-container cloud-agent.
Get the queue the running queue:work worker is processing.
Get the connection name for the queue.
Set the connection name for the queue.
Set the queue configuration array.
Get the queueable options from the job.
Finish processing the current job and emit a queue event.
Last job details resolver.
Handle jobs finishing being queued.
Normalize the queue name.
Get the names of the managed queues configured for this connection.
Dynamically pass method calls to the underlying queue.
Details
protected mixed
forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object.
protected mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object, returning $this if the forwarded call returned itself.
static protected never
throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
__construct(Application $app, Queue $queue, Events $events, array $config)
Create a new Queue instance.
int
size(UnitEnum|string|null $queue = null)
Get the size of the queue.
int
pendingSize(UnitEnum|string|null $queue = null)
Get the number of pending jobs.
int
delayedSize(UnitEnum|string|null $queue = null)
Get the number of delayed jobs.
int
reservedSize(UnitEnum|string|null $queue = null)
Get the number of reserved jobs.
int
totalSize()
Get the number of jobs across every managed queue.
int
totalPendingSize()
Get the number of pending jobs across every managed queue.
int
totalDelayedSize()
Get the number of delayed jobs across every managed queue.
int
totalReservedSize()
Get the number of reserved jobs across every managed queue.
InspectedJob>
pendingJobs(UnitEnum|string|null $queue = null)
Get the pending jobs for the given queue.
InspectedJob>
delayedJobs(UnitEnum|string|null $queue = null)
Get the delayed jobs for the given queue.
InspectedJob>
reservedJobs(UnitEnum|string|null $queue = null)
Get the reserved jobs for the given queue.
InspectedJob>
allPendingJobs()
Get all pending jobs across every queue.
InspectedJob>
allDelayedJobs()
Get all delayed jobs across every queue.
InspectedJob>
allReservedJobs()
Get all reserved jobs across every queue.
int|null
creationTimeOfOldestPendingJob(UnitEnum|string|null $queue = null)
Get the creation timestamp of the oldest pending job, excluding delayed jobs.
mixed
push(string|object $job, mixed $data = '', UnitEnum|string|null $queue = null)
Push a new job onto the queue.
mixed
pushOn(UnitEnum|string $queue, string|object $job, mixed $data = '')
Push a new job onto the queue.
mixed
pushRaw(string $payload, UnitEnum|string|null $queue = null, array $options = [])
Push a raw payload onto the queue.
mixed
later(DateTimeInterface|DateInterval|int $delay, string|object $job, mixed $data = '', UnitEnum|string|null $queue = null)
Push a new job onto the queue after (n) seconds.
mixed
laterOn(UnitEnum|string $queue, DateTimeInterface|DateInterval|int $delay, string|object $job, mixed $data = '')
Push a new job onto a specific queue after (n) seconds.
mixed
bulk(array $jobs, mixed $data = '', UnitEnum|string|null $queue = null)
Push an array of jobs onto the queue.
Job|null
pop(UnitEnum|string|null $queue = null)
Pop the next job off of the queue.
Jobs come straight from SQS unless the cloud-agent is enabled.
When cloud-agent is enabled, we long-poll the agent's runtime socket instead.
protected CloudJob|null
popFromAgent()
Long-poll the cloud-agent's runtime socket and wrap the next message in a CloudJob.
protected array|null
requestNextJobFromAgent()
Long-poll the agent's runtime socket (GET /next) for the next job.
protected void
reportJobStatusToAgent(string $messageId, string|null $receiptHandle, string $status, int|null $delay = null)
Report a job's terminal outcome back to the agent (POST /result).
protected PendingRequest
agentRequest()
Get a pending HTTP request bound to the agent's Unix runtime socket.
int
clear(string $queue)
Delete all of the jobs from the queue.
protected bool
usesAgent(string|null $queue = null)
Determine whether the next job should be received from the in-container cloud-agent.
protected string
workerQueue()
Get the queue the running queue:work worker is processing.
string
getConnectionName()
Get the connection name for the queue.
$this
setConnectionName(string $name)
Set the connection name for the queue.
$this
setConfig(array $config)
Set the queue configuration array.
array
getQueueableOptions(mixed $job, string|null $queue, string $payload, DateTimeInterface|DateInterval|int|null $delay = null)
Get the queueable options from the job.
void
finishProcessingJob(string $default = 'processed', CarbonImmutable|null $timestamp = null)
Finish processing the current job and emit a queue event.
CarbonImmutable}
processingJobDetails()
Last job details resolver.
finishQueueingJob(string $queue)
Handle jobs finishing being queued.
protected void
startProcessingJob(string|null $queue, Job|null $job)
Handle a job being popped.
string
normalizeQueue(string|null $queue)
Normalize the queue name.
array<int, string>
managedQueues()
Get the names of the managed queues configured for this connection.
mixed
__call(string $method, array $parameters)
Dynamically pass method calls to the underlying queue.