Enqueue a task for execution.
The resolved value type of the task promise.
Async function to execute.
Optional priority and custom id.
A promise that resolves/rejects with the task result.
If the queue is full (see SchedulerOptions.maxQueueSize).
Resolves when the queue is completely idle: no running tasks, no pending starters, no queued items.
Reject and remove all queued (not-yet-started) jobs. Running jobs are unaffected.
OptionalfinalError: unknownOptional reason; defaults to a generic cancellation Error.
Temporarily stop starting new tasks. Running tasks continue.
Resume starting tasks if previously paused.
Whether the scheduler is currently paused.
Number of running tasks + pending starters (<= maxConcurrency).
Current number of enqueued items (not counting in-flight starters).
Create a new scheduler.
See SchedulerOptions
A priority-first FIFO async scheduler with bounded concurrency.
Higher priority buckets are drained first; within the same priority, jobs execute in FIFO order. Backpressure is applied via
maxQueueSize.Key characteristics
maxConcurrencyExample: Add two tasks with different priorities