<?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: Our Ajax Conventions&#8211;Clientside Continuations</title>
	<atom:link href="http://lostechies.com/josharnold/2012/01/06/our-ajax-conventionsclientside-continuations/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/josharnold/2012/01/06/our-ajax-conventionsclientside-continuations/</link>
	<description>Startups, open source, and coffee.</description>
	<lastBuildDate>Mon, 20 May 2013 20:00:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/josharnold/2012/01/06/our-ajax-conventionsclientside-continuations/#comment-116</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 21 Feb 2012 06:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=136#comment-116</guid>
		<description>Yes, precisely. We actually plugin to $.ajax as a global convention. Basically if you call: $.ajax and do not specify a success callback, then this fires: 
https://github.com/DarthFubuMVC/jquery-continuations/blob/master/jquery.continuations.js#L150

If you want to participate in that pipeline, you can call $.continuations.applyPolicy. (I cover this in my latest post http://lostechies.com/josharnold/2012/02/18/jquery-continuations-in-action/)

You can also specify a continuationSuccess callback to $.ajax that lets you hook in before the pipeline. Or just provide a success callback and override altogether.</description>
		<content:encoded><![CDATA[<p>Yes, precisely. We actually plugin to $.ajax as a global convention. Basically if you call: $.ajax and do not specify a success callback, then this fires: <br />
<a href="https://github.com/DarthFubuMVC/jquery-continuations/blob/master/jquery.continuations.js#L150" rel="nofollow">https://github.com/DarthFubuMVC/jquery-continuations/blob/master/jquery.continuations.js#L150</a></p>
<p>If you want to participate in that pipeline, you can call $.continuations.applyPolicy. (I cover this in my latest post http://lostechies.com/josharnold/2012/02/18/jquery-continuations-in-action/)</p>
<p>You can also specify a continuationSuccess callback to $.ajax that lets you hook in before the pipeline. Or just provide a success callback and override altogether.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://lostechies.com/josharnold/2012/01/06/our-ajax-conventionsclientside-continuations/#comment-115</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 21 Feb 2012 05:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=136#comment-115</guid>
		<description>Excellent. I just realized I could mix event streaming and still use a traditional $.ajax() success callback to have it basically skip this whole pipeline when events are not needed. I was thinking you routed all responses through Amplify.</description>
		<content:encoded><![CDATA[<p>Excellent. I just realized I could mix event streaming and still use a traditional $.ajax() success callback to have it basically skip this whole pipeline when events are not needed. I was thinking you routed all responses through Amplify.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/josharnold/2012/01/06/our-ajax-conventionsclientside-continuations/#comment-114</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 21 Feb 2012 04:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=136#comment-114</guid>
		<description>Let&#039;s split those two up for clarity: the server simply tracks the correlation id so you have more control of your requests. Honestly, this is most beneficial in one place: automated testing. We keep track of pending requests so that we have a fairly reliable condition to test against while we &quot;wait&quot; for async stuff to process.


The topic/payload piece is just part of the pipeline and are completely optional. We&#039;ve found that the continuations represent more of a snapshot of the system state and then we layer on metadata. That&#039;s vague so let me expand on that with an example:

Our system is time-sensitive and we capture &quot;timestamps&quot; for entities in the system (e.g., &quot;The patient was here at 12:00&quot;). Our first pass at the endpoint for this sent back a continuation with the topic/payload of: &quot;timestamp-updated&quot;/{ relevant entity info }. That was then relayed through our clientside event aggregator. When websockets were introduced, the clientside didn&#039;t have to change because it was already listening for that topic. My point being: the topic/payload thing works great for event-based systems (i.e., event sourcing).
I understand your hesitation about the mixing of UI/non-UI concerns but consider it from more of an API approach where you provide entity-related information. An example being: Create a User. The response could return the id of the User and some urls (github does this in their api when requesting resources that are paginated).</description>
		<content:encoded><![CDATA[<p>Let&#8217;s split those two up for clarity: the server simply tracks the correlation id so you have more control of your requests. Honestly, this is most beneficial in one place: automated testing. We keep track of pending requests so that we have a fairly reliable condition to test against while we &#8220;wait&#8221; for async stuff to process.</p>
<p>The topic/payload piece is just part of the pipeline and are completely optional. We&#8217;ve found that the continuations represent more of a snapshot of the system state and then we layer on metadata. That&#8217;s vague so let me expand on that with an example:</p>
<p>Our system is time-sensitive and we capture &#8220;timestamps&#8221; for entities in the system (e.g., &#8220;The patient was here at 12:00&#8243;). Our first pass at the endpoint for this sent back a continuation with the topic/payload of: &#8220;timestamp-updated&#8221;/{ relevant entity info }. That was then relayed through our clientside event aggregator. When websockets were introduced, the clientside didn&#8217;t have to change because it was already listening for that topic. My point being: the topic/payload thing works great for event-based systems (i.e., event sourcing).<br />
I understand your hesitation about the mixing of UI/non-UI concerns but consider it from more of an API approach where you provide entity-related information. An example being: Create a User. The response could return the id of the User and some urls (github does this in their api when requesting resources that are paginated).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://lostechies.com/josharnold/2012/01/06/our-ajax-conventionsclientside-continuations/#comment-113</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 21 Feb 2012 04:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=136#comment-113</guid>
		<description>This is very cool! One question though. Whenever you request data from the server do you have to send a &quot;topic&quot; with the payload, or do you use the correlationId somehow? It seems that requiring a topic server-side could lead to some mixing of UI and non-UI concerns. As far as I could tell, correlationId is only available on the &quot;AjaxCompleted&quot; event.  I suppose if you are streaming multiple results with web sockets the topic concept makes more sense.</description>
		<content:encoded><![CDATA[<p>This is very cool! One question though. Whenever you request data from the server do you have to send a &#8220;topic&#8221; with the payload, or do you use the correlationId somehow? It seems that requiring a topic server-side could lead to some mixing of UI and non-UI concerns. As far as I could tell, correlationId is only available on the &#8220;AjaxCompleted&#8221; event.  I suppose if you are streaming multiple results with web sockets the topic concept makes more sense.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
