For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages
are available by appending .md to any URL.
Interface Scheduler
interface Scheduler {
postTask(
callback: SchedulerPostTaskCallback,
options?: SchedulerPostTaskOptions,
): Promise<any>;
yield(): Promise<void>;
}
postTask(
callback: SchedulerPostTaskCallback,
options?: SchedulerPostTaskOptions,
): Promise<any>;
yield(): Promise<void>;
}
Methods
postTask
-
The
postTask()method of the Scheduler interface is used for adding tasks to be scheduled according to their priority.Parameters
- callback: SchedulerPostTaskCallback
Optionaloptions: SchedulerPostTaskOptions
Returns Promise<any>
yield
-
The
yield()method of the Scheduler interface is used for yielding to the main thread during a task and continuing execution later, with the continuation scheduled as a prioritized task (see the Prioritized Task Scheduling API for more information). This allows long-running work to be broken up so the browser stays responsive.Returns Promise<void>
The
Schedulerinterface of the Prioritized Task Scheduling API provides methods for scheduling prioritized tasks.MDN Reference