Core\Queue
Runs work in the background. push saves a job as a row in the database set by [queue] connection, and a worker runs the job later. Inside a transaction on that connection, the job is saved only when the transaction commits. status, cancel and delete work on one job. stats and purge work on a whole queue.
Members
6 members.
| Member | Signature |
|---|---|
push | push(string $script, { arguments?: mixed, queue?: string, runAt?: Core\Time\Instant, maxAttempts?: uint, backoff?: Core\Time\Duration, key?: string, tag?: string, grants?: array<string>, memory?: string, cpuTime?: string, wallTime?: string, maxOutput?: string }): Core\Queue\Id |
status | status(Core\Queue\Id $job): Core\Queue::State |
cancel | cancel(Core\Queue\Id $job): bool |
stats | stats(string $queue): Core\Queue\Stats |
delete | delete(Core\Queue\Id $job): bool |
purge | purge(string $queue, { state?: Core\Queue::State, tag?: string, before?: Core\Time\Instant, limit?: uint }): uint |
Enums
StateThe state of a background job, asCore\Queue::statusreturns it. There are five states and noFailedstate. A failed attempt is retried, so the job goes back toPending.
