Hello I''m creating some domain availability checker for multiple domains in PHP in combination with Ajax. Everything works, except, Ajax.Updater from Prototype waits until one task is finished before it starts the next task. So there are no simultaneous lookups, it''s like Prototype puts all the requests in some queue. Is there a way to force simultaneous requests? Example: Code: function doLookup(){ for(i = 0; i < ids.length; i++){ checkADomain(ids[i], exts[i], domains[i]); } } window.onload = function(){ doLookup(); } function checkADomain(id, ext, domain){ /* same problem with Ajax.Updater */ new Ajax.Request(''index.php?do=checkdomain'', { method: ''post'', parameters: {domain: domain, ext: ext, id: id}, onComplete: function(transport){ $(id).update(transport.responseText); }}); } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
iBram wrote:> Hello > > I''m creating some domain availability checker for multiple domains in > PHP in combination with Ajax. > Everything works, except, Ajax.Updater from Prototype waits until one > task is finished before it starts the next task. So there are no > simultaneous lookups, it''s like Prototype puts all the requests in > some queue. > > Is there a way to force simultaneous requests?Prototype doesn''t queue anything up, but browsers do set limits on the number of simultaneous connections they allow at once. I think it''s usually 2 per window/tab. I have something similar in a project where they can be a dozen or more little sections of the page that need information which can sometimes take a while to generate on the server side. So instead of using Ajax.Updater I use Ajax.Request to make the initial request to the server to start the calculations and then use subsequent Ajax.Request objects to keep polling the server to see if the data is ready. Performs much better and appears to the user to have several open requests at the same time. -- Michael Peters Developer Plus Three, LP --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for your reply. Strange thing is that I could get it working with some other Ajax library (http://www.twilightuniverse.com/projects/sack/). If I code my previous script in this little ajax framework, it does really fire all requests at the same time. That''s why I thought it could be done in Prototype too... On 26 apr, 15:36, Michael Peters <mpet...-aUYv5hkjw45l57MIdRCFDg@public.gmane.org> wrote:> iBram wrote: > > Hello > > > I''m creating some domain availability checker for multiple domains in > > PHP in combination with Ajax. > > Everything works, except, Ajax.Updater from Prototype waits until one > > task is finished before it starts the next task. So there are no > > simultaneous lookups, it''s like Prototype puts all the requests in > > some queue. > > > Is there a way to force simultaneous requests? > > Prototype doesn''t queue anything up, but browsers do set limits on the number of > simultaneous connections they allow at once. I think it''s usually 2 per window/tab. > > I have something similar in a project where they can be a dozen or more little > sections of the page that need information which can sometimes take a while to > generate on the server side. So instead of using Ajax.Updater I use Ajax.Request > to make the initial request to the server to start the calculations and then use > subsequent Ajax.Request objects to keep polling the server to see if the data is > ready. Performs much better and appears to the user to have several open > requests at the same time. > > -- > Michael Peters > Developer > Plus Three, LP--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---