async/task_scheduler_utils library
Priority task scheduler with a concurrency limit — roadmap #655.
Runs at most N async tasks at once; when a slot frees, the highest-priority
waiting task runs next (FIFO among equal priorities). This is the piece the
FIFO AsyncSemaphoreUtils can't provide: a semaphore admits waiters in
arrival order, whereas a scheduler reorders the backlog by importance — so an
urgent task jumps ahead of a queue of background work without preempting the
jobs already running.
Classes
- TaskScheduler
-
Schedules async tasks under a fixed concurrency cap, dispatching the
highest-priority waiter whenever a slot opens. Higher schedule
priorityvalues run first; equal priorities preserve submission order.
Typedefs
-
ScheduledTask<
T> = Future< T> Function() - Produces the future result of one scheduled task.