Skip to content

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.

MemberSignature
pushpush(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
statusstatus(Core\Queue\Id $job): Core\Queue::State
cancelcancel(Core\Queue\Id $job): bool
statsstats(string $queue): Core\Queue\Stats
deletedelete(Core\Queue\Id $job): bool
purgepurge(string $queue, { state?: Core\Queue::State, tag?: string, before?: Core\Time\Instant, limit?: uint }): uint

Enums

  • StateThe state of a background job, as Core\Queue::status returns it. There are five states and no Failed state. A failed attempt is retried, so the job goes back to Pending.