Language: Python · Sphere: programming · Category: Async
Async Task Queue with Priority and Retries
A production-ready async task queue implementation with priority levels, automatic retries with exponential backoff, and dead-letter queue handling.
When it runs, async task queue guarantees stats['completed'] == 3 and stats['processing'] == 0; s['completed'] == 3; order == ['high', 'norm', 'low'] (proven by run).
Checkable constraints:
order == ['high', 'norm', 'low']await q.dequeue() is Noneawait q.complete_task(t_high.id) is Trueawait q.complete_task(t_high.id) is Falseawait q.complete_task('ghost') is Falsestats['completed'] == 3 and stats['processing'] == 0got.id == flaky.idawait q.fail_task(flaky.id, 'boom-1') is True
- Green-run: ✓ passes (re-run under the extractor's gate)
- Constraint strength: recovery (truth-pinned)
- Independent oracle: ✓ consensus — xlang (validator v1.9)
- Peer review: unreviewed
△ AURA Pattern Library — © Reality Optimizer