Skip to content

RecordingQueueDriver

A decorating queue driver: wraps a real inner QueueDriverInterface and appends one EffectKind::Queue entry per RecordingQueueDriver::push() to an injected EffectLedger, then returns exactly as the real driver did.

Scoped to push() only: reserve()/ack()/release()/discard() on PollableQueueDriverInterface belong to an out-of-process worker polling the backlog later, not to the request that enqueued the job, and are not observed here.

push() returns void, and no driver hands back an id or other value a caller could observe from the call itself (see e.g. Quiote\Queue\Db\DbQueueDriver/Quiote\Queue\Redis\RedisQueueDriver, whose generated ids are internal to the backend) — so the effect’s result is null; there is nothing else genuine to record.

A real driver exception is never swallowed: no effect is recorded for a failed push, and the exception propagates exactly as it would through the undecorated driver, matching every other recorder in this package.

final class RecordingQueueDriver implements QueueDriverInterface

ImplementsQueueDriverInterface
SourceQueue/RecordingQueueDriver.php

public function __construct(QueueDriverInterface $driver, EffectLedger $ledger, ClockInterface $clock = new SystemClock(…)): mixed

ParameterTypeDescription
$driverQueueDriverInterface
$ledgerEffectLedger
$clockClockInterface

Returns mixed

MethodDescription
describe(JobPayload $payload): array<string, mixed>
push(JobPayload $payload): voidHands a job off to the driver’s backend.

public static function describe(JobPayload $payload): array<string, mixed>

ParameterTypeDescription
$payloadJobPayload

Returns array``<``string``, ``mixed``>

public function push(JobPayload $payload): void

Hands a job off to the driver’s backend.

Implementors either enqueue the payload for later execution or, for the in-process SyncQueueDriver, run it inline and block until it succeeds or exhausts its retries. A payload carrying a non-null JobPayload::$availableAt must not become visible to a worker before that moment.

ParameterTypeDescription
$payloadJobPayload