<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Serial Asynchronous XmlHttpRequests</title>
	<atom:link href="http://ajaxian.com/archives/serial-async-xhr/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/serial-async-xhr</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: alshur</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274608</link>
		<dc:creator>alshur</dc:creator>
		<pubDate>Mon, 20 Jul 2009 15:33:37 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274608</guid>
		<description>that&#039;s a good pattern to remember, anyway</description>
		<content:encoded><![CDATA[<p>that&#8217;s a good pattern to remember, anyway</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marc</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274086</link>
		<dc:creator>marc</dc:creator>
		<pubDate>Mon, 22 Jun 2009 11:08:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274086</guid>
		<description>Vaadin (previously IT Mill Toolkit) also does this internally, although the implementation is a bit more complex than the simple example shown - as someone noted above, there are many cases to consider, e.g user clicks Button A and Button B in quick succession, but Button A removes Button B. You want to be as asynchronous as possible, but not asynchronousier ;-)</description>
		<content:encoded><![CDATA[<p>Vaadin (previously IT Mill Toolkit) also does this internally, although the implementation is a bit more complex than the simple example shown &#8211; as someone noted above, there are many cases to consider, e.g user clicks Button A and Button B in quick succession, but Button A removes Button B. You want to be as asynchronous as possible, but not asynchronousier ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jgw</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274069</link>
		<dc:creator>jgw</dc:creator>
		<pubDate>Sat, 20 Jun 2009 02:47:47 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274069</guid>
		<description>1. Synchronous XHR is not simply a bad idea; it&#039;s a wildly unacceptable design that should be stricken from existence, and certainly never used. It&#039;s fundamentally impossible to implement it within a browser under Javascript&#039;s threading model (or lack thereof), in a way that doesn&#039;t blow.

2. This is decidedly not a good idea for performance the way it&#039;s described. If you need to make &quot;multiple requests&quot;, have all the necessary information at one point in time, but need to serialize them, then what you have is a single request. Otherwise, you&#039;re just slowing everything down by creating unnecessary HTTP connections.</description>
		<content:encoded><![CDATA[<p>1. Synchronous XHR is not simply a bad idea; it&#8217;s a wildly unacceptable design that should be stricken from existence, and certainly never used. It&#8217;s fundamentally impossible to implement it within a browser under Javascript&#8217;s threading model (or lack thereof), in a way that doesn&#8217;t blow.</p>
<p>2. This is decidedly not a good idea for performance the way it&#8217;s described. If you need to make &#8220;multiple requests&#8221;, have all the necessary information at one point in time, but need to serialize them, then what you have is a single request. Otherwise, you&#8217;re just slowing everything down by creating unnecessary HTTP connections.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzammetti</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274056</link>
		<dc:creator>fzammetti</dc:creator>
		<pubDate>Fri, 19 Jun 2009 19:22:36 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274056</guid>
		<description>@andrewwell: That&#039;s a pretty obnoxious reply on your part, don&#039;t you think?  Why the need for sarcasm there?  If you&#039;re not a fan of DWR, no problem... if you&#039;re sick of me expressing how good a project I think it is, just ignore me...  If you don&#039;t agree with the sentiment, I&#039;m all for a respectful discourse on the subject.  But I see no point in being glib.</description>
		<content:encoded><![CDATA[<p>@andrewwell: That&#8217;s a pretty obnoxious reply on your part, don&#8217;t you think?  Why the need for sarcasm there?  If you&#8217;re not a fan of DWR, no problem&#8230; if you&#8217;re sick of me expressing how good a project I think it is, just ignore me&#8230;  If you don&#8217;t agree with the sentiment, I&#8217;m all for a respectful discourse on the subject.  But I see no point in being glib.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dumky</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274053</link>
		<dc:creator>Dumky</dc:creator>
		<pubDate>Fri, 19 Jun 2009 18:09:06 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274053</guid>
		<description>Hi Dion,

I stumbled on a library, called Flapjax, for reactive programming which makes this kind of pattern easy. The basic idea is that instead of using a callback model for coding reactive patterns, you chain functions on an event stream abstraction.

In this instance you would write something like this pseudo-code:
triggerEventStream.CallXHR(call1).CallXHR(call2).CallXHR(call3).
If you want to trigger it only once, you can have triggerEventStream be a stream with a single event.

I haven&#039;t used that library yet, but the event stream abstraction seems really useful. It can also be used to handle reacting to UI events.

Here&#039;s a good tutorial which explains how a naive Flapjax implementation might work: http://www.weaselhat.com/2007/08/11/lifting-in-flapjax/</description>
		<content:encoded><![CDATA[<p>Hi Dion,</p>
<p>I stumbled on a library, called Flapjax, for reactive programming which makes this kind of pattern easy. The basic idea is that instead of using a callback model for coding reactive patterns, you chain functions on an event stream abstraction.</p>
<p>In this instance you would write something like this pseudo-code:<br />
triggerEventStream.CallXHR(call1).CallXHR(call2).CallXHR(call3).<br />
If you want to trigger it only once, you can have triggerEventStream be a stream with a single event.</p>
<p>I haven&#8217;t used that library yet, but the event stream abstraction seems really useful. It can also be used to handle reacting to UI events.</p>
<p>Here&#8217;s a good tutorial which explains how a naive Flapjax implementation might work: <a href="http://www.weaselhat.com/2007/08/11/lifting-in-flapjax/" rel="nofollow">http://www.weaselhat.com/2007/08/11/lifting-in-flapjax/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sasuke</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274052</link>
		<dc:creator>sasuke</dc:creator>
		<pubDate>Fri, 19 Jun 2009 18:02:41 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274052</guid>
		<description>but is possiblle also using setTimeout with sync call ajax:

seTimeout(function() {
  var res1=$.ajax({url:&quot;http://1&quot;,async:false});
  var res2=$.ajax({url:&quot;http://2&quot;,async:false});
  var res3=$.ajax({url:&quot;http://3&quot;,async:false});


},0);</description>
		<content:encoded><![CDATA[<p>but is possiblle also using setTimeout with sync call ajax:</p>
<p>seTimeout(function() {<br />
  var res1=$.ajax({url:&#8221;http://1&#8243;,async:false});<br />
  var res2=$.ajax({url:&#8221;http://2&#8243;,async:false});<br />
  var res3=$.ajax({url:&#8221;http://3&#8243;,async:false});</p>
<p>},0);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrewwell</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274051</link>
		<dc:creator>andrewwell</dc:creator>
		<pubDate>Fri, 19 Jun 2009 17:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274051</guid>
		<description>&quot;I’ve said it before and I’ll say it again: if you’re doing Java-based Ajax work and not using DWR, up the dosage my friend :)&quot;

yeah, you&#039;re the smart one out here. hopefully you&#039;ve said enough and not find a need to say it again.</description>
		<content:encoded><![CDATA[<p>&#8220;I’ve said it before and I’ll say it again: if you’re doing Java-based Ajax work and not using DWR, up the dosage my friend :)&#8221;</p>
<p>yeah, you&#8217;re the smart one out here. hopefully you&#8217;ve said enough and not find a need to say it again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzammetti</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274044</link>
		<dc:creator>fzammetti</dc:creator>
		<pubDate>Fri, 19 Jun 2009 15:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274044</guid>
		<description>For those of us living in DWR-land, it&#039;s as easy as:

dwr.engine.beginBatch();
  // Multiple Ajax calls go here
dwr.engine.endBatch();

You get the callbacks firing in the order you made the Ajax calls (which of course, thanks to DWR, look just like JavaScript function calls) and as an added bonus, you get only a single request made to the server (although it could be hitting multiple objects on the server).

I&#039;ve said it before and I&#039;ll say it again: if you&#039;re doing Java-based Ajax work and not using DWR, up the dosage my friend :)</description>
		<content:encoded><![CDATA[<p>For those of us living in DWR-land, it&#8217;s as easy as:</p>
<p>dwr.engine.beginBatch();<br />
  // Multiple Ajax calls go here<br />
dwr.engine.endBatch();</p>
<p>You get the callbacks firing in the order you made the Ajax calls (which of course, thanks to DWR, look just like JavaScript function calls) and as an added bonus, you get only a single request made to the server (although it could be hitting multiple objects on the server).</p>
<p>I&#8217;ve said it before and I&#8217;ll say it again: if you&#8217;re doing Java-based Ajax work and not using DWR, up the dosage my friend :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ChrisHeilmann</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274035</link>
		<dc:creator>ChrisHeilmann</dc:creator>
		<pubDate>Fri, 19 Jun 2009 14:32:31 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274035</guid>
		<description>What if I dont want to print out on paper? Seriously, print(&#039;done&#039;)? :)</description>
		<content:encoded><![CDATA[<p>What if I dont want to print out on paper? Seriously, print(&#8216;done&#8217;)? :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ThomasHansen</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274031</link>
		<dc:creator>ThomasHansen</dc:creator>
		<pubDate>Fri, 19 Jun 2009 12:49:19 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274031</guid>
		<description>To have multiple Ajax Requests being executed serialized (still asynchronously though, think &quot;queue&quot; and not &quot;synchronized&quot;) is not only important, but it is also absolutely 100% imperative for many reasons. One simple example can be imagined when having two requests serializing the form and sending it back, then the first request removes or adds elements to the form in some manners... KABOOM...!
.
I have previously written extensively about the subject here; http://ra-ajax.org/how-to-create-an-ajax-library-part-5-wrapping-the-xmlhttprequest-xhr-object.blog
And here; http://ra-ajax.org/how-to-create-an-ajax-library-part-7-the-ra-ajax-class.blog
.
Also sometimes (though more seldom) you wish to execute XHR requests synchronously, one example is when you embed a JavaScript file into the page as a result of a callback. Then you wish to make sure that JS file is finished &quot;executing&quot; before you reference objects and types within it.
.
The first one is quite interesting (advanced) in implementation, but still not anymore advanced then that most serious Ajax Frameworks have had support for it for months, and often years. Like for instance http://ra-ajax.org - Disclaimer; I work with Ra-Ajax, remember...
.
To see this in action try to expand multiple items here; http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx -  *VERY* fast...
.
The second one is easier, though in fact fewer (possibly because of not that much of a demand) Ajax Frameworks really needs this possibility, which though when implemented nicely will seriously increase your maneuverability in regards to features and such in both your applications and your framework. Since then you can embed advanced widgets in Ajax Callbacks as response to some Business Logic happening on the server...
.
The first one though is probably the most underestimated things of all times in regards to Ajax, and also the most important feature *ANY* Ajax Framework can give you, though few does in fact ...
.
I think it&#039;s nice of Ajaxian to finally start focusing on this now though ...
.
But the knowledge about these subjects have been out there for years...!
.
May I suggest a little bit more focus on frameworks, solutions, architecture and (framework-)design and a little bit less focus on DHTML and bling...?</description>
		<content:encoded><![CDATA[<p>To have multiple Ajax Requests being executed serialized (still asynchronously though, think &#8220;queue&#8221; and not &#8220;synchronized&#8221;) is not only important, but it is also absolutely 100% imperative for many reasons. One simple example can be imagined when having two requests serializing the form and sending it back, then the first request removes or adds elements to the form in some manners&#8230; KABOOM&#8230;!<br />
.<br />
I have previously written extensively about the subject here; <a href="http://ra-ajax.org/how-to-create-an-ajax-library-part-5-wrapping-the-xmlhttprequest-xhr-object.blog" rel="nofollow">http://ra-ajax.org/how-to-create-an-ajax-library-part-5-wrapping-the-xmlhttprequest-xhr-object.blog</a><br />
And here; <a href="http://ra-ajax.org/how-to-create-an-ajax-library-part-7-the-ra-ajax-class.blog" rel="nofollow">http://ra-ajax.org/how-to-create-an-ajax-library-part-7-the-ra-ajax-class.blog</a><br />
.<br />
Also sometimes (though more seldom) you wish to execute XHR requests synchronously, one example is when you embed a JavaScript file into the page as a result of a callback. Then you wish to make sure that JS file is finished &#8220;executing&#8221; before you reference objects and types within it.<br />
.<br />
The first one is quite interesting (advanced) in implementation, but still not anymore advanced then that most serious Ajax Frameworks have had support for it for months, and often years. Like for instance <a href="http://ra-ajax.org" rel="nofollow">http://ra-ajax.org</a> &#8211; Disclaimer; I work with Ra-Ajax, remember&#8230;<br />
.<br />
To see this in action try to expand multiple items here; <a href="http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx" rel="nofollow">http://ra-ajax.org/samples/Ajax-Forum-Starter-Kit.aspx</a> &#8211;  *VERY* fast&#8230;<br />
.<br />
The second one is easier, though in fact fewer (possibly because of not that much of a demand) Ajax Frameworks really needs this possibility, which though when implemented nicely will seriously increase your maneuverability in regards to features and such in both your applications and your framework. Since then you can embed advanced widgets in Ajax Callbacks as response to some Business Logic happening on the server&#8230;<br />
.<br />
The first one though is probably the most underestimated things of all times in regards to Ajax, and also the most important feature *ANY* Ajax Framework can give you, though few does in fact &#8230;<br />
.<br />
I think it&#8217;s nice of Ajaxian to finally start focusing on this now though &#8230;<br />
.<br />
But the knowledge about these subjects have been out there for years&#8230;!<br />
.<br />
May I suggest a little bit more focus on frameworks, solutions, architecture and (framework-)design and a little bit less focus on DHTML and bling&#8230;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WebReflection</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274026</link>
		<dc:creator>WebReflection</dc:creator>
		<pubDate>Fri, 19 Jun 2009 12:14:43 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274026</guid>
		<description>A queue system would be much simpler and better, imho.</description>
		<content:encoded><![CDATA[<p>A queue system would be much simpler and better, imho.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JChung2008</title>
		<link>http://ajaxian.com/archives/serial-async-xhr/comment-page-1#comment-274025</link>
		<dc:creator>JChung2008</dc:creator>
		<pubDate>Fri, 19 Jun 2009 12:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6973#comment-274025</guid>
		<description>Continuations and coroutines FTW!</description>
		<content:encoded><![CDATA[<p>Continuations and coroutines FTW!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

