class QueuePoolProxy extends PoolProxy implements Queue, IndexAwareQueue, PublishesOutboxMessages

Traits

Properties

protected string $connectionName

The logical connection name applied to each borrowed queue.

protected Queue): mixed): mixed $afterCommitDispatcher

Methods

__construct(PoolDefinition $definition, Closure $createCallback, Factory $pools, Closure|null $releaseCallback = null)

Create a pooled queue proxy.

pool()

Resolve the current pool for this proxy's definition.

lease()

Return idle database sessions before waiting for a queue connection.

mixed
invoke(string $method, array $arguments)

Invoke a synchronous method on a borrowed object.

void
configureBorrowed(object $object)

Apply the proxy's logical connection name to a borrowed queue.

getDefinition()

Get this proxy's immutable pool definition.

string
getPoolName()

Return the pool's fully qualified registry name.

bool
invalidatePool()

Remove and close this proxy's current shared pool.

int
secondsUntil(DateInterval|DateTimeInterface|int $delay)

Get the number of seconds until the given DateTime.

int
availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)

Get the "available at" UNIX timestamp.

parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)

If the given value is an interval, convert it to a DateTime instance.

int
currentTime()

Get the current system time as a UNIX timestamp.

string
runTimeForHumans(float $startTime, float|null $endTime = null)

Given a start time, format the total run time for human readability.

publishOutboxMessagesSequentially(Queue $queue, array $messages)

Publish due raw messages and defer future messages without losing their delays.

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 queue.

int
totalPendingSize()

Get the number of pending jobs across every queue.

int
totalDelayedSize()

Get the number of delayed jobs across every queue.

int
totalReservedSize()

Get the number of reserved jobs across every queue.

pendingJobs(UnitEnum|string|null $queue = null)

Get the pending jobs for the given queue.

delayedJobs(UnitEnum|string|null $queue = null)

Get the delayed jobs for the given queue.

reservedJobs(UnitEnum|string|null $queue = null)

Get the reserved jobs for the given queue.

allPendingJobs()

Get all pending jobs across every queue.

allDelayedJobs()

Get all delayed jobs across every queue.

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(object|string $job, mixed $data = '', UnitEnum|string|null $queue = null)

Push a new job onto the queue.

mixed
pushOn(UnitEnum|string|null $queue, object|string $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(DateInterval|DateTimeInterface|int $delay, object|string $job, mixed $data = '', UnitEnum|string|null $queue = null)

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

mixed
laterOn(UnitEnum|string|null $queue, DateInterval|DateTimeInterface|int $delay, object|string $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.

publishOutboxMessages(array $messages)

Publish a stored batch while borrowing its transport only once.

mixed
withConnection(Closure $callback)

Run a callback with the underlying SQS queue.

Job|null
pop(UnitEnum|string|null $queue = null, int $index = 0)

Pop the next job off of the queue.

string
getConnectionName()

Get the connection name for the queue.

setConnectionName(string $name)

Set the connection name for the queue.

mixed
usingConnection(Closure $callback)

Run a callback with a borrowed queue.

Details

at line 47
__construct(PoolDefinition $definition, Closure $createCallback, Factory $pools, Closure|null $releaseCallback = null)

Create a pooled queue proxy.

Parameters

PoolDefinition $definition
Closure $createCallback
Factory $pools
Closure|null $releaseCallback

in PoolProxy at line 29
protected ObjectPool pool()

Resolve the current pool for this proxy's definition.

Return Value

ObjectPool

at line 359
protected Lease lease()

Return idle database sessions before waiting for a queue connection.

Return Value

Lease

in PoolProxy at line 55
protected mixed invoke(string $method, array $arguments)

Invoke a synchronous method on a borrowed object.

Parameters

string $method
array $arguments

Return Value

mixed

at line 369
protected void configureBorrowed(object $object)

Apply the proxy's logical connection name to a borrowed queue.

Parameters

object $object

Return Value

void

in PoolProxy at line 80
PoolDefinition getDefinition()

Get this proxy's immutable pool definition.

Return Value

PoolDefinition

in PoolProxy at line 88
string getPoolName()

Return the pool's fully qualified registry name.

Return Value

string

in PoolProxy at line 96
bool invalidatePool()

Remove and close this proxy's current shared pool.

Return Value

bool

in InteractsWithTime at line 17
protected int secondsUntil(DateInterval|DateTimeInterface|int $delay)

Get the number of seconds until the given DateTime.

Parameters

DateInterval|DateTimeInterface|int $delay

Return Value

int

in InteractsWithTime at line 29
protected int availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)

Get the "available at" UNIX timestamp.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

int

in InteractsWithTime at line 47
protected DateTimeInterface|int parseDateInterval(DateInterval|DateTimeInterface|int|null $delay)

If the given value is an interval, convert it to a DateTime instance.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

DateTimeInterface|int

in InteractsWithTime at line 63
protected int currentTime()

Get the current system time as a UNIX timestamp.

Return Value

int

in InteractsWithTime at line 71
protected string runTimeForHumans(float $startTime, float|null $endTime = null)

Given a start time, format the total run time for human readability.

Parameters

float $startTime
float|null $endTime

Return Value

string

protected OutboxBatchResult publishOutboxMessagesSequentially(Queue $queue, array $messages)

Publish due raw messages and defer future messages without losing their delays.

Parameters

Queue $queue
array $messages

Return Value

OutboxBatchResult

at line 69
int size(UnitEnum|string|null $queue = null)

Get the size of the queue.

Parameters

UnitEnum|string|null $queue

Return Value

int

at line 77
int pendingSize(UnitEnum|string|null $queue = null)

Get the number of pending jobs.

Parameters

UnitEnum|string|null $queue

Return Value

int

at line 85
int delayedSize(UnitEnum|string|null $queue = null)

Get the number of delayed jobs.

Parameters

UnitEnum|string|null $queue

Return Value

int

at line 93
int reservedSize(UnitEnum|string|null $queue = null)

Get the number of reserved jobs.

Parameters

UnitEnum|string|null $queue

Return Value

int

at line 101
int totalSize()

Get the number of jobs across every queue.

Return Value

int

at line 109
int totalPendingSize()

Get the number of pending jobs across every queue.

Return Value

int

at line 117
int totalDelayedSize()

Get the number of delayed jobs across every queue.

Return Value

int

at line 125
int totalReservedSize()

Get the number of reserved jobs across every queue.

Return Value

int

at line 133
Collection pendingJobs(UnitEnum|string|null $queue = null)

Get the pending jobs for the given queue.

Parameters

UnitEnum|string|null $queue

Return Value

Collection

at line 141
Collection delayedJobs(UnitEnum|string|null $queue = null)

Get the delayed jobs for the given queue.

Parameters

UnitEnum|string|null $queue

Return Value

Collection

at line 149
Collection reservedJobs(UnitEnum|string|null $queue = null)

Get the reserved jobs for the given queue.

Parameters

UnitEnum|string|null $queue

Return Value

Collection

at line 157
Collection allPendingJobs()

Get all pending jobs across every queue.

Return Value

Collection

at line 165
Collection allDelayedJobs()

Get all delayed jobs across every queue.

Return Value

Collection

at line 173
Collection allReservedJobs()

Get all reserved jobs across every queue.

Return Value

Collection

at line 181
int|null creationTimeOfOldestPendingJob(UnitEnum|string|null $queue = null)

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

Parameters

UnitEnum|string|null $queue

Return Value

int|null

at line 189
mixed push(object|string $job, mixed $data = '', UnitEnum|string|null $queue = null)

Push a new job onto the queue.

Parameters

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

Return Value

mixed

at line 197
mixed pushOn(UnitEnum|string|null $queue, object|string $job, mixed $data = '')

Push a new job onto the queue.

Parameters

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

Return Value

mixed

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

Push a raw payload onto the queue.

Parameters

string $payload
UnitEnum|string|null $queue
array $options

Return Value

mixed

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

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

Parameters

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

Return Value

mixed

at line 221
mixed laterOn(UnitEnum|string|null $queue, DateInterval|DateTimeInterface|int $delay, object|string $job, mixed $data = '')

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

Parameters

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

Return Value

mixed

at line 229
mixed bulk(array $jobs, mixed $data = '', UnitEnum|string|null $queue = null)

Push an array of jobs onto the queue.

Parameters

array $jobs
mixed $data
UnitEnum|string|null $queue

Return Value

mixed

at line 239
OutboxBatchResult publishOutboxMessages(array $messages)

Publish a stored batch while borrowing its transport only once.

Parameters

array $messages

Return Value

OutboxBatchResult

at line 254
mixed withConnection(Closure $callback)

Run a callback with the underlying SQS queue.

Parameters

Closure $callback

Return Value

mixed

at line 269
Job|null pop(UnitEnum|string|null $queue = null, int $index = 0)

Pop the next job off of the queue.

Parameters

UnitEnum|string|null $queue
int $index

Return Value

Job|null

at line 334
string getConnectionName()

Get the connection name for the queue.

Return Value

string

at line 348
Queue setConnectionName(string $name)

Set the connection name for the queue.

Queue connection proxies are cached on QueueManager; runtime use races across coroutines and changes every concurrent dispatch through this connection.

Parameters

string $name

Return Value

Queue

at line 381
protected mixed usingConnection(Closure $callback)

Run a callback with a borrowed queue.

Parameters

Closure $callback

Return Value

mixed