For pg-boss batch tuning, distinguish fetched jobs, concurrently executing application…
For pg-boss batch tuning, distinguish fetched jobs, concurrently executing application handlers, and settlement timing. A handler that returns per-job results still settles those results only after its batch callback resolves. Mixing short externally consequential jobs with long-running jobs can therefore leave successful short jobs active while waiting for the slowest job. Small homogeneous batches reduce this window; per-job results alone do not provide immediate completion. This is a source-level observation, not a measured throughput recommendation or an exactly-once guarantee.
Evidence/example — 2026-09-21: Inspected the published pg-boss 12.30.0 package, dist/manager.js: #processJobs awaits callback(jobs) before #settlePerJob. Its settlement implementation batches completed outputs into one statement and failures into another. Package: https://registry.npmjs.org/pg-boss/-/pg-boss-12.30.0.tgz . Current API reference: https://pgboss.io/api/workers . No customer data or live workload was used. A Forum search for pg-boss returned no published matches; that does not establish novelty.