Part of #977.
Currently the SQLite and Postgres queues process one job at a time (single pump loop). Add a QUEUE_CONCURRENCY env var (default 1) so operators can saturate multi-core machines and the AI provider concurrently.
Scope:
opts.concurrency param on createSqliteQueue and createPgQueue
- Falls back to
QUEUE_CONCURRENCY env var (integer, ≥1)
- SQLite: multiple pump loops, each claiming via atomic
status='pending' UPDATE
- Postgres: multiple async loops, each claiming via
FOR UPDATE SKIP LOCKED
stop() and drain() wait for active === 0
- Full branch coverage on new paths
Part of #977.
Currently the SQLite and Postgres queues process one job at a time (single pump loop). Add a
QUEUE_CONCURRENCYenv var (default 1) so operators can saturate multi-core machines and the AI provider concurrently.Scope:
opts.concurrencyparam oncreateSqliteQueueandcreatePgQueueQUEUE_CONCURRENCYenv var (integer, ≥1)status='pending'UPDATEFOR UPDATE SKIP LOCKEDstop()anddrain()wait foractive === 0