v0.22.0
PGQueuer v0.22.0 — soft-breaking release 🚦
Overview
v0.22.0 introduces real-time job completion and a lightweight schema tweak that powers dramatic speedups. Your workflows will continue to run unchanged, but without the database upgrade you’ll see up to 20× slower status queries—hence the “soft-breaking” label.
🔶 Soft-Breaking Change: New Index Required
-
What: A composite index
…_job_id_statusonqueue_table_log. -
Why: Accelerates the new
job_status()calls and underpins the CompletionWatcher mechanism. -
Impact if skipped: Workers fall back to sequential scans for status lookups—expect 10–20× latency when awaiting or monitoring jobs.
-
Fix:
pgq upgrade
✨ Major Features & Improvements
-
CompletionWatcher API
-
Await any job (or group) via
LISTEN/NOTIFY+ 5 s safety-poll + 50 ms debounce -
Usage:
from pgqueuer.completion import CompletionWatcher async with CompletionWatcher(driver) as w: status = await w.wait_for(job_id) # "successful", "exception", …
-
Helpers:
wait_for_all(),wait_for_first()for bulk scripts/tests
-
-
AsyncpgPoolDriver
- Pooled connections are now the recommended default in docs/examples
- Single-connection
AsyncpgDriverremains supported
🛠️ Migration Guide
-
Upgrade your schema
pgq upgrade
-
(Optional) Adopt CompletionWatcher
from pgqueuer.completion import CompletionWatcher async with CompletionWatcher(driver) as w: await w.wait_for(job_id)