isTaskScheduledAtPriorityOrHigher method

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Returns a Boolean value indicating whether there is pending work at the given priority level or higher.

Internet Explorer 10

 

Syntax

var retval = MSApp.isTaskScheduledAtPriorityOrHigher(priority);

Parameters

  • priority [in]
    Type: DOMString

    A priority value (see MSApp Constants) specifying the priority level and above to query for any outstanding queued work.

Return value

Type: boolean

Returns true if there is any queued work at the specified priority level or above, false otherwise.

Remarks

The isTaskScheduledAtPriorityOrHigher method provides a means for JavaScript code to determine if there is pending work at the various priority levels (or above) with the intent that the calling JavaScript code can then decide to yield to higher priority work.

Examples

function performIdleWork(array_in) {
  var idx = 0;

  function performIdleWorkHelper() {
    for (; idx < array_in.length; ++idx) {

      // USEFUL CODE HERE 

      if (MSApp.isTaskScheduledAtPriorityOrHigher(MSApp.NORMAL)) {
        MSApp.execAsyncAtPriority(performIdleWorkHelper, msPriority.IDLE);
        break;
      } // if
    } // for
  } // performIdleWorkHelper

  performIdleWorkHelper();
} // performIdleWork

See also

MSApp

MSApp Constants