Maximum number of tasks running at once (default: 1).
An object with methods to add tasks and inspect queue state.
Add a new async task to the queue.
Returns the number of currently active/running tasks.
Returns the number of pending tasks in the queue.
Creates an async task queue with controlled concurrency.
Tasks are executed in FIFO order, respecting the concurrency limit. Each
add
call returns a promise that resolves/rejects with the task result.