New MooTools Plugin: Request.Queue

Aaron Newton announced the availability of Request.Queue to queue up multiple requests (The Request class lets you handle more than one request but this plugin comes in handy when you have multiple instances of the Request class or its subclasses) and have them run one, two or three (depends on how many you want) at a time. He also puts together a code snippet to show how it would look if we wanted the queue to process one Request at a time.

Here is the code example from the clientside blog:

  var num1 = new Request({ url: '/wiki/simple.php', data: {num: 1, sleep: 1}, method: 'get',
 
      onComplete: function(response){ console.log(response) } });
 
  var num2 = new Request({ url: '/wiki/simple.php', data: {num: 2, sleep: 1}, method: 'get',
 
      onComplete: function(response){ console.log(response) } });
 
  var num3 = new Request({ url: '/wiki/simple.php', data: {num: 3, sleep: 1}, method: 'get',
 
      onComplete: function(response){ console.log(response) } });
 
  var myQueue = new Request.Queue();
 
  //you can add them one at a time
 
  myQueue.addRequest('num1', num1);
 
  //or in a single call
 
  myQueue.addRequests({ num2: num2, num3: num3 });
 
  num1.send();
 
  num2.send();
 
  num3.send();

[Post to Twitter] Tweet This Post

This entry was posted on Monday, December 1st, 2008 and is filed under News. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Print Posts del.icio.us:New MooTools Plugin: Request.Queue digg:New MooTools Plugin: Request.Queue spurl:New MooTools Plugin: Request.Queue wists:New MooTools Plugin: Request.Queue simpy:New MooTools Plugin: Request.Queue newsvine:New MooTools Plugin: Request.Queue blinklist:New MooTools Plugin: Request.Queue furl:New MooTools Plugin: Request.Queue reddit:New MooTools Plugin: Request.Queue fark:New MooTools Plugin: Request.Queue blogmarks:New MooTools Plugin: Request.Queue Y!:New MooTools Plugin: Request.Queue smarking:New MooTools Plugin: Request.Queue magnolia:New MooTools Plugin: Request.Queue segnalo:New MooTools Plugin: Request.Queue gifttagging:New MooTools Plugin: Request.Queue Slashdot Slashdot It! Stumble it!

Leave a Reply

Sponsors

rrripple

Translator

English flagItalian flagKorean flagChinese (Simplified) flagPortuguese flagGerman flag
French flagSpanish flagJapanese flagArabic flagRussian flagGreek flag
Dutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flag
Hindi flagPolish flagRumanian flagSwedish flagNorwegian flag 
By N2H

Archive

Future of Digital Publishing

Session from Adobe MAX 2009:
(Future of Digital Publishing: Delivering News Through Adobe AIR)

[Post to Twitter] Tweet This Post

Thanks for stopping by!