JobExecutor
Shared retry/backoff decision logic used by both SyncQueueDriver (in-process blocking retry loop) and QueueWorker (one attempt per poll, deferred retry via the driver), so the policy is not duplicated per driver.
Jobs are rebuilt per attempt via Container::make() — the same fresh-per-call autowiring actions/views already get.
Synopsis
Section titled “Synopsis”final readonly class JobExecutor
| Source | JobExecutor.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(Container $container, FailedJobStoreInterface $failedJobStore, int $defaultMaxAttempts = 3, int $defaultBackoffSeconds = 5): mixed
| Parameter | Type | Description |
|---|---|---|
$container | Container | |
$failedJobStore | FailedJobStoreInterface | |
$defaultMaxAttempts | int | |
$defaultBackoffSeconds | int |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
attempt(JobPayload $payload): ?ExecutionFailure | Construct and run the job once. |
executeWithRetries(JobPayload $payload): void | Run a job to completion in-process, blocking (with usleep) between retries. |
attempt()
Section titled “attempt()”public function attempt(JobPayload $payload): ?ExecutionFailure
Construct and run the job once.
Returns null on success, or an ExecutionFailure describing whether to retry (with delay) or give up (already recorded to the failed-job store in that case).
| Parameter | Type | Description |
|---|---|---|
$payload | JobPayload |
Returns ?ExecutionFailure
executeWithRetries()
Section titled “executeWithRetries()”public function executeWithRetries(JobPayload $payload): void
Run a job to completion in-process, blocking (with usleep) between retries.
Used by SyncQueueDriver only — a persistent driver’s worker loop instead defers retries via release() (see QueueWorker).
| Parameter | Type | Description |
|---|---|---|
$payload | JobPayload |