schedulePromiseXXX<\/b> : there is a lot of functions with similar names(schedulePromiseAboveNormal, etc.). These functions takes a promise as a parameter. It assures that the completion\/error handler is processed on the scheduler with the given priority. If you want a completion handler tob be processed as soon as the promise is done, then use schedulePromiseHigh. <\/li>\n<\/ul>\nHere are some code example :
\n[js]
\n\/\/requestDrain example
\nvar drainPromise = WinJS.Utilities.Scheduler.requestDrain(priority, name);<\/p>\n
drainPromise.done(
\n function complete(){console.log("queue drained");},
\n function error(){ });<\/p>\n
\/\/retrieveState example :
\nvar S= WinJS.Utilities.Scheduler;
\nS.schedule(function () {\/* *\/ }, S.Priority.aboveNormal,null,"a task name");
\nS.schedule(function () {\/* *\/ }, S.Priority.idle,null, "infinite square name");
\nS.schedule(function () {\/* *\/ }, S.Priority.belowNormal,null,"another task name");<\/p>\n
var state = WinJS.Utilities.Scheduler.retrieveState();
\n\/*
\n state looks like this :
\n Jobs:
\n id: 22, priority: aboveNormal, name: a task name
\n id: 24, priority: belowNormal, name: another task name
\n id: 23, priority: idle, name: infinite square name
\n\tDrain requests:
\n None
\n*\/<\/p>\n
\/\/schedulePromiseXXX example
\nvar dldPromise = WinJS.xhr({url:’www.infiniteSquare.com’});
\nWinJS.Utilities.Scheduler.schedulePromiseHigh(dldPromise)
\n .then(function(xhrResult){
\n \/* process interesting content *\/
\n });<\/p>\n
[\/js]<\/p>\n
Regards.<\/p>\n","protected":false},"excerpt":{"rendered":"
Windows 8.1 comes with a new feature in the WinJS SDK : a scheduler. Let’s see what it is and how to use it! In Windows 8, every job is nearly done as soon as…<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[28],"tags":[14,15,30,34,25,53],"_links":{"self":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1471"}],"collection":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/comments?post=1471"}],"version-history":[{"count":26,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1471\/revisions"}],"predecessor-version":[{"id":1498,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1471\/revisions\/1498"}],"wp:attachment":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/media?parent=1471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/categories?post=1471"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/tags?post=1471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}