Hyperlinkv0.8.0-beta.28

Scheduler

Scheduler.SchedulerDispatcherinterfaceeffect/Scheduler.ts:57
SchedulerDispatcher

A dispatcher created by a Scheduler for enqueuing tasks and forcing queued tasks to run.

When to use

Use when implementing or testing scheduler-created dispatchers that enqueue prioritized runtime tasks and flush queued work deterministically.

Details

scheduleTask queues a task with a priority. flush drains pending work synchronously, which is useful when callers need deterministic completion of already scheduled tasks. Lower priority numbers run first, and equal priorities run in FIFO order.

models
export interface SchedulerDispatcher {
  scheduleTask(task: () => void, priority: number): void
  flush(): void
}
Referenced by 5 symbols