Platinum Partner

JobQueue in Javascript

My code snippet is a very easy and simple form of execute a jobs in javascript. it could use to organize a XMLHttpRequest's

view more info luis.caribecoders.com

function function1(){  // Function #1
 alert('Hello');
}

function function2(){  // Function #1
 alert('World');
}

var queue= [];                     // <- This is a Vector in this case a queue representation.
 queue.push(function1);      // <- storage a function #1 in a queue vector.
 queue.push(function2);      // <- storage a function #2 in a queue vector.
   while (cola.length > 0) {   // <- iterate a queue vector and execute the functions.
      (queue.shift())();            // <- Excecute the process. 
    }
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}