hydrakit / queue
Work that outlives the request: a job contract, a database queue with retries, drained by the scheduler.
Requires
- php: >=8.4
- hydrakit/console: ^0.31
- hydrakit/core: ^0.31
- hydrakit/database: ^0.31
- hydrakit/scheduler: ^0.31
- psr/clock: ^1.0
- psr/container: ^2.0
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
Requires (Dev)
- ext-pdo_sqlite: *
- hydrakit/event: ^0.31
- hydrakit/log: ^0.31
- phpunit/phpunit: ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main / 0.31.x-dev
- v0.31.2
- v0.31.1
- v0.31.0
- v0.30.0
- v0.29.0
- v0.28.0
- v0.27.0
- v0.26.0
- v0.25.0
- v0.24.0
- v0.23.0
- v0.22.1
- v0.22.0
- v0.21.0
- v0.20.0
- v0.19.0
- v0.18.0
- v0.17.0
- v0.16.0
- v0.15.0
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.0
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.17
- v0.9.16
- v0.9.15
- v0.9.14
- v0.9.13
- v0.9.12
- v0.9.11
- v0.9.10
- v0.9.9
- v0.9.8
- v0.9.7
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
This package is auto-updated.
Last update: 2026-10-09 13:58:39 UTC
README
Part of the Hydra PHP framework. Documentation: hydra.williamhleucka.com/docs.
Read-only mirror.
hydrakit/queueis developed in hydra-foundation/hydra underpackages/queue, and republished here on every push. A commit pushed to this repository is overwritten by the next one; issues are disabled for that reason, and a pull request opened here cannot be merged. Both belong upstream.
Work that outlives the request. A JobInterface is built by the container
and handed the payload it was pushed with; QueueInterface::push() takes the
job's class, a payload of scalars, nulls and arrays, stored as JSON, and an
optional delay in seconds.
DatabaseQueue keeps jobs in a jobs table and failures in failed_jobs.
There is no daemon: Worker is a scheduler batch,
$schedule->drain(Worker::class)->everyMinute(), that claims up to twenty
jobs at a time. A job that finishes is deleted. One that throws is tried again
after 10 seconds, then 60, and after its third failure moves to failed_jobs
with the exception. A claim whose worker died is taken again after fifteen
minutes, and the attempt is counted when the job is claimed, so a job that
kills its worker still runs out of tries.
queue:failed lists what ran out of tries, newest first, with the
exception's message. queue:retry <id> puts one back on the queue, due now
and with its tries restored; queue:retry --all puts back every one.
queue:forget <id> deletes one without running it, and queue:flush
deletes them all.
Testing\FakeQueue records pushes for assertQueued(), and refuses whatever
the database queue would.