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

mixed
forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

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 never
throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

__construct(Queue $queue, Events $events, array $config)

Create a new Queue instance.

int
size(string|null $queue = null)

Get the size of the queue.

int
pendingSize(string|null $queue = null)

Get the number of pending jobs.

int
delayedSize(string|null $queue = null)

Get the number of delayed jobs.

int
reservedSize(string|null $queue = null)

Get the number of reserved jobs.

int|null
creationTimeOfOldestPendingJob(string|null $queue = null)

Get the creation timestamp of the oldest pending job, excluding delayed jobs.

mixed
push(string|object $job, mixed $data = '', string|null $queue = null)

Push a new job onto the queue.

mixed
pushOn(string $queue, string|object $job, mixed $data = '')

Push a new job onto the queue.

mixed
pushRaw(string $payload, string|null $queue = null, array $options = [])

Push a raw payload onto the queue.

mixed
later(DateTimeInterface|DateInterval|int $delay, string|object $job, mixed $data = '', string|null $queue = null)

Push a new job onto the queue after (n) seconds.

mixed
laterOn(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 = '', string|null $queue = null)

Push an array of jobs onto the queue.

Job|null
pop(string|null $queue = null)

Pop the next job off of the queue.

int
clear(string $queue)

Delete all of the jobs from the queue.

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.

processingJobDetails()

Last job details resolver.

finishQueueingJob(string $queue)

Handle jobs finishing being queued.

void
startProcessingJob(string|null $queue, Job|null $job)

Handle a job being popped.

string
normalizeQueue(string|null $queue)

Normalize the queue name.

mixed
__call(string $method, array $parameters)

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.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

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.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

Exceptions

BadMethodCallException

__construct(Queue $queue, Events $events, array $config)

Create a new Queue instance.

Parameters

Queue $queue
Events $events
array $config

int size(string|null $queue = null)

Get the size of the queue.

Parameters

string|null $queue

Return Value

int

int pendingSize(string|null $queue = null)

Get the number of pending jobs.

Parameters

string|null $queue

Return Value

int

int delayedSize(string|null $queue = null)

Get the number of delayed jobs.

Parameters

string|null $queue

Return Value

int

int reservedSize(string|null $queue = null)

Get the number of reserved jobs.

Parameters

string|null $queue

Return Value

int

int|null creationTimeOfOldestPendingJob(string|null $queue = null)

Get the creation timestamp of the oldest pending job, excluding delayed jobs.

Parameters

string|null $queue

Return Value

int|null

mixed push(string|object $job, mixed $data = '', string|null $queue = null)

Push a new job onto the queue.

Parameters

string|object $job
mixed $data
string|null $queue

Return Value

mixed

mixed pushOn(string $queue, string|object $job, mixed $data = '')

Push a new job onto the queue.

Parameters

string $queue
string|object $job
mixed $data

Return Value

mixed

mixed pushRaw(string $payload, string|null $queue = null, array $options = [])

Push a raw payload onto the queue.

Parameters

string $payload
string|null $queue
array $options

Return Value

mixed

mixed later(DateTimeInterface|DateInterval|int $delay, string|object $job, mixed $data = '', string|null $queue = null)

Push a new job onto the queue after (n) seconds.

Parameters

DateTimeInterface|DateInterval|int $delay
string|object $job
mixed $data
string|null $queue

Return Value

mixed

mixed laterOn(string $queue, DateTimeInterface|DateInterval|int $delay, string|object $job, mixed $data = '')

Push a new job onto a specific queue after (n) seconds.

Parameters

string $queue
DateTimeInterface|DateInterval|int $delay
string|object $job
mixed $data

Return Value

mixed

mixed bulk(array $jobs, mixed $data = '', string|null $queue = null)

Push an array of jobs onto the queue.

Parameters

array $jobs
mixed $data
string|null $queue

Return Value

mixed

Job|null pop(string|null $queue = null)

Pop the next job off of the queue.

Parameters

string|null $queue

Return Value

Job|null

int clear(string $queue)

Delete all of the jobs from the queue.

Parameters

string $queue

Return Value

int

string getConnectionName()

Get the connection name for the queue.

Return Value

string

$this setConnectionName(string $name)

Set the connection name for the queue.

Parameters

string $name

Return Value

$this

$this setConfig(array $config)

Set the queue configuration array.

Parameters

array $config

Return Value

$this

array getQueueableOptions(mixed $job, string|null $queue, string $payload, DateTimeInterface|DateInterval|int|null $delay = null)

Get the queueable options from the job.

Parameters

mixed $job
string|null $queue
string $payload
DateTimeInterface|DateInterval|int|null $delay

Return Value

array

void finishProcessingJob(string $default = 'processed', CarbonImmutable|null $timestamp = null)

Finish processing the current job and emit a queue event.

Parameters

string $default
CarbonImmutable|null $timestamp

Return Value

void

processingJobDetails()

Last job details resolver.

finishQueueingJob(string $queue)

Handle jobs finishing being queued.

Parameters

string $queue

protected void startProcessingJob(string|null $queue, Job|null $job)

Handle a job being popped.

Parameters

string|null $queue
Job|null $job

Return Value

void

protected string normalizeQueue(string|null $queue)

Normalize the queue name.

Parameters

string|null $queue

Return Value

string

mixed __call(string $method, array $parameters)

Dynamically pass method calls to the underlying queue.

Parameters

string $method
array $parameters

Return Value

mixed