Поделиться через


WinJS.Utilities.Scheduler

Provides functions and objects for scheduling and managing asynchronous tasks.

The WinJS.Utilities.Scheduler namespace has these types of members:

  • Enumerations
  • Interfaces
  • Functions

Enumerations

Enumeration Description

Priority enumeration

Represents a priority for a job managed by the Scheduler.

 

Interfaces

Interface Description

IJob interface

Represents a work item that's executed by the Scheduler.

IJobInfo interface

Provides a control mechanism that allows a job to cooperatively yield.

IOwnerToken interface

Represents an object that owns jobs. You can use this object to cancel a set of jobs.

 

Functions

Function Description

createOwnerToken function

Creates and returns a new IOwnerToken which can be set to the owner property of one or more jobs.

execHigh function

Runs the specified callback in a high priority context.

retrieveState function

Returns a string representation of the scheduler's state for diagnostic purposes. The jobs and drain requests are displayed in the order in which they are currently expected to be processed. The current job and drain request are marked by an asterisk.

requestDrain function

Runs jobs in the scheduler without timeslicing until all jobs at the specified priority and higher have executed.

schedule function

Schedules the specified function to execute asynchronously.

schedulePromiseAboveNormal function

Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.aboveNormal priority. This function is to be used as a onCompleted handler in Promise chains to set the priority of the next link in the chain.

schedulePromiseBelowNormal function

Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.belowNormal priority. This function is to be used as a onCompleted handler in Promise chains to set the priority of the next link in the chain.

schedulePromiseHigh function

Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.high priority. This function is to be used as a onCompleted handler in Promise chains to set the priority of the next link in the chain.

schedulePromiseIdle function

Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.Idle priority. This function is to be used as a onCompleted handler in Promise chains to set the priority of the next link in the chain.

schedulePromiseNormal function

Schedules a job to complete the returned Promise at WinJS.Utilities.Scheduler.Priority.normal priority. This function is to be used as a onCompleted handler in Promise chains to set the priority of the next link in the chain.

 

Requirements

Minimum WinJS version

WinJS 2.0

Namespace

WinJS.Utilities.Scheduler