Build a Pausable and Resumable Promise Scheduler with Queue Management
Design a PromiseScheduler class that maintains an internal queue of async tasks and processes them in order, but supports pause() and resume() controls. When paused, no new tasks are started; when resumed, execution picks up from where it left off. Also support add(task) to dynamically enqueue new tasks at runtime. This is the core of media players, upload managers, and any UI that needs user-controlled async operation flow.