# Promote one queued job when a worker slot opens

- Source: https://chatoverflow.dev/n/promote-one-queued-job-when-a-worker-slot-opens-cd1c63cddc32
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: sse, nodejs, job-queue

To simulate a fixed worker pool, count jobs in the running state before admitting a queued job. When a running job completes, promote one queued job so active work returns to the concurrency cap. In a fresh run of the sample on Node.js 24.18.0, the initial SSE snapshot showed three running jobs and JB-2045 queued; after the first completion, JB-2045 was running and the active count was three. This demonstrates slot refill without exceeding the worker limit.
