QueuePoolProxy
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
Create a pooled queue proxy.
Invoke a synchronous method on a borrowed object.
Apply the proxy's logical connection name to a borrowed queue.
Get the number of seconds until the given DateTime.
Get the "available at" UNIX timestamp.
If the given value is an interval, convert it to a DateTime instance.
Given a start time, format the total run time for human readability.
Publish due raw messages and defer future messages without losing their delays.
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 queue.
Get the number of pending jobs across every queue.
Get the number of delayed jobs across every queue.
Get the number of reserved jobs across every 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.
Publish a stored batch while borrowing its transport only once.
Get the connection name for the queue.
Set the connection name for the queue.
Details
at line 47
__construct(PoolDefinition $definition, Closure $createCallback, Factory $pools, Closure|null $releaseCallback = null)
Create a pooled queue proxy.
in
PoolProxy at line 29
protected ObjectPool
pool()
Resolve the current pool for this proxy's definition.
at line 359
protected Lease
lease()
Return idle database sessions before waiting for a queue connection.
in
PoolProxy at line 55
protected mixed
invoke(string $method, array $arguments)
Invoke a synchronous method on a borrowed object.
at line 369
protected void
configureBorrowed(object $object)
Apply the proxy's logical connection name to a borrowed queue.
in
PoolProxy at line 80
PoolDefinition
getDefinition()
Get this proxy's immutable pool definition.
in
PoolProxy at line 88
string
getPoolName()
Return the pool's fully qualified registry name.
in
PoolProxy at line 96
bool
invalidatePool()
Remove and close this proxy's current shared pool.
in
InteractsWithTime at line 17
protected int
secondsUntil(DateInterval|DateTimeInterface|int $delay)
Get the number of seconds until the given DateTime.
in
InteractsWithTime at line 29
protected int
availableAt(DateInterval|DateTimeInterface|int|null $delay = 0)
Get the "available at" UNIX timestamp.
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.
in
InteractsWithTime at line 63
protected int
currentTime()
Get the current system time as a UNIX timestamp.
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.
in
PublishesOutboxMessagesSequentially at line 23
protected OutboxBatchResult
publishOutboxMessagesSequentially(Queue $queue, array $messages)
Publish due raw messages and defer future messages without losing their delays.
at line 69
int
size(UnitEnum|string|null $queue = null)
Get the size of the queue.
at line 77
int
pendingSize(UnitEnum|string|null $queue = null)
Get the number of pending jobs.
at line 85
int
delayedSize(UnitEnum|string|null $queue = null)
Get the number of delayed jobs.
at line 93
int
reservedSize(UnitEnum|string|null $queue = null)
Get the number of reserved jobs.
at line 101
int
totalSize()
Get the number of jobs across every queue.
at line 109
int
totalPendingSize()
Get the number of pending jobs across every queue.
at line 117
int
totalDelayedSize()
Get the number of delayed jobs across every queue.
at line 125
int
totalReservedSize()
Get the number of reserved jobs across every queue.
at line 133
Collection
pendingJobs(UnitEnum|string|null $queue = null)
Get the pending jobs for the given queue.
at line 141
Collection
delayedJobs(UnitEnum|string|null $queue = null)
Get the delayed jobs for the given queue.
at line 149
Collection
reservedJobs(UnitEnum|string|null $queue = null)
Get the reserved jobs for the given queue.
at line 157
Collection
allPendingJobs()
Get all pending jobs across every queue.
at line 165
Collection
allDelayedJobs()
Get all delayed jobs across every queue.
at line 173
Collection
allReservedJobs()
Get all reserved jobs across every queue.
at line 181
int|null
creationTimeOfOldestPendingJob(UnitEnum|string|null $queue = null)
Get the creation timestamp of the oldest pending job, excluding delayed jobs.
at line 189
mixed
push(object|string $job, mixed $data = '', UnitEnum|string|null $queue = null)
Push a new job onto the queue.
at line 197
mixed
pushOn(UnitEnum|string|null $queue, object|string $job, mixed $data = '')
Push a new job onto the queue.
at line 205
mixed
pushRaw(string $payload, UnitEnum|string|null $queue = null, array $options = [])
Push a raw payload onto the queue.
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.
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.
at line 229
mixed
bulk(array $jobs, mixed $data = '', UnitEnum|string|null $queue = null)
Push an array of jobs onto the queue.
at line 239
OutboxBatchResult
publishOutboxMessages(array $messages)
Publish a stored batch while borrowing its transport only once.
at line 254
mixed
withConnection(Closure $callback)
Run a callback with the underlying SQS queue.
at line 269
Job|null
pop(UnitEnum|string|null $queue = null, int $index = 0)
Pop the next job off of the queue.
at line 334
string
getConnectionName()
Get the connection name for the queue.
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.
at line 381
protected mixed
usingConnection(Closure $callback)
Run a callback with a borrowed queue.