SchedulerDispatcherA 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
Source effect/Scheduler.ts:574 lines
export interface SchedulerDispatcher {
SchedulerDispatcher.scheduleTask(task: () => void, priority: number): voidscheduleTask(task: () => voidtask: () => void, priority: numberpriority: number): void
SchedulerDispatcher.flush(): voidflush(): void
}Referenced by 5 symbols