OutboxRelay
class OutboxRelay
Traits
Methods
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.
Create a relay whose dependencies do not retain borrowed connections.
Claim messages and release the source connection before returning.
Publish and settle a claimed batch, returning whether it completed without failure.
Reject driver results that cannot safely identify the rows to settle.
Notify listeners and report failures after publication and settlement have released their resources.
Finish an operation's resource cleanup before returning or propagating cancellation.
Details
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 29
__construct(DatabaseOutboxRepository $repository, Factory $queues, Dispatcher $events, ExceptionHandler $exceptions)
Create a relay whose dependencies do not retain borrowed connections.
at line 42
array
claim(string $database, int $limit)
Claim messages and release the source connection before returning.
at line 52
bool
deliver(string $database, array $messages)
Publish and settle a claimed batch, returning whether it completed without failure.
at line 121
protected bool
shouldStopDelivery(Throwable $exception)
Determine whether cancellation requires delivery to stop.
at line 131
protected OutboxBatchResult
validateResult(array $messages, OutboxBatchResult $result)
Reject driver results that cannot safely identify the rows to settle.
at line 169
protected void
reportOutcome(string $database, string $connection, array $messages, OutboxBatchResult $result, Throwable|null $settlementFailure, float $duration, int $publishedAt)
Notify listeners and report failures after publication and settlement have released their resources.
at line 244
protected mixed
inFreshCoroutine(Closure $callback)
Finish an operation's resource cleanup before returning or propagating cancellation.