Rate-Limit Execution of a Task Array Using a Throttle Concurrency Controller

Write a function that accepts an array of async tasks and a concurrency limit N, and executes them in batches — no more than N tasks running simultaneously at any time. As soon as one task completes, the next pending task starts immediately to maintain maximum throughput. This is different from basic throttling — it's a concurrency pool and is fundamental to rate-limited API calls, file upload queues, and resource-constrained job systems.

Examples
Input: []
Output:
Hints

Rate-Limit Execution of a Task Array Using a Throttle Concurrency Controller

Write a function that accepts an array of async tasks and a concurrency limit N, and executes them in batches — no more than N tasks running simultaneously at any time. As soon as one task completes, the next pending task starts immediately to maintain maximum throughput. This is different from basic throttling — it's a concurrency pool and is fundamental to rate-limited API calls, file upload queues, and resource-constrained job systems.