Ordered Async Callback Processing Engine with Concurrency Control
Build a scheduling engine that accepts a queue of asynchronous callback tasks and processes them in a controlled manner. The engine must: (1) process callbacks strictly in the order they were enqueued (FIFO); (2) support a configurable concurrency limit — e.g., run at most N tasks simultaneously; (3) start the next task as soon as any running task completes (not waiting for the entire batch); (4) handle task failures gracefully without stopping the queue; (5) support pause() and resume() controls on the queue. This models real-world task runners, job queues, and async middleware pipelines.