<?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 for The If Works</title>
	<atom:link href="http://blog.jcoglan.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jcoglan.com</link>
	<description>This dirt was a building before</description>
	<lastBuildDate>Sun, 14 Mar 2010 00:08:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Faye: a Comet client and server for Node.js and Rack by Robert K</title>
		<link>http://blog.jcoglan.com/2010/02/02/faye-a-comet-client-and-server-for-node-js-and-rack/comment-page-1/#comment-4309</link>
		<dc:creator>Robert K</dc:creator>
		<pubDate>Sun, 14 Mar 2010 00:08:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=526#comment-4309</guid>
		<description>make that &quot;return setTimeout(...)&quot;</description>
		<content:encoded><![CDATA[<p>make that &#8220;return setTimeout(&#8230;)&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Faye: a Comet client and server for Node.js and Rack by Robert K</title>
		<link>http://blog.jcoglan.com/2010/02/02/faye-a-comet-client-and-server-for-node-js-and-rack/comment-page-1/#comment-4308</link>
		<dc:creator>Robert K</dc:creator>
		<pubDate>Sun, 14 Mar 2010 00:08:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=526#comment-4308</guid>
		<description>Nice piece of work!  However it&#039;d be nice if there were some support for error handling.  &#039;Looks like your XHR transport code quietly ignores a variety of error cases.

I&#039;m looking specifically at the case where the server gets restarted during a long-poll request.  In this case, there&#039;s no response and the Faye clients simply stop polling.  At a minimum, there should be a way to configure the behavior in this case (e.g. &quot;retry every 10 seconds&quot;)

Also, I&#039;d prefer to have a way to adjust the polling frequency of the Faye.XHR readystate check. (10ms strikes me as a bit aggressive.)

... oh, and also, you might consider doing this:
&lt;blockquote&gt;if (self._xhr.readyState !== 4) setTimeout(handleState, 10)&lt;/blockquote&gt;
... instead of using setInterval.  It&#039;s simpler, and avoids potential issues with multiple setInterval calls getting queued up if CPU performance lags for whatever reason.</description>
		<content:encoded><![CDATA[<p>Nice piece of work!  However it&#8217;d be nice if there were some support for error handling.  &#8216;Looks like your XHR transport code quietly ignores a variety of error cases.</p>
<p>I&#8217;m looking specifically at the case where the server gets restarted during a long-poll request.  In this case, there&#8217;s no response and the Faye clients simply stop polling.  At a minimum, there should be a way to configure the behavior in this case (e.g. &#8220;retry every 10 seconds&#8221;)</p>
<p>Also, I&#8217;d prefer to have a way to adjust the polling frequency of the Faye.XHR readystate check. (10ms strikes me as a bit aggressive.)</p>
<p>&#8230; oh, and also, you might consider doing this:</p>
<blockquote><p>if (self._xhr.readyState !== 4) setTimeout(handleState, 10)</p></blockquote>
<p>&#8230; instead of using setInterval.  It&#8217;s simpler, and avoids potential issues with multiple setInterval calls getting queued up if CPU performance lags for whatever reason.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on JS.Class and Helium updates by dalmaer at 03/10/10 07:31:22 &#124; Exectweets</title>
		<link>http://blog.jcoglan.com/2010/03/09/js-class-and-helium-updates/comment-page-1/#comment-4300</link>
		<dc:creator>dalmaer at 03/10/10 07:31:22 &#124; Exectweets</dc:creator>
		<pubDate>Wed, 10 Mar 2010 07:53:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=669#comment-4300</guid>
		<description>[...] Pro Tweets       James Coglan has released updates to JS.Class and Helium. http://blog.jcoglan.com/2010/03/09/js-class-and-helium-updates/       dalmaer  - Wed 10 Mar 7:31                           All Things [...]</description>
		<content:encoded><![CDATA[<p>[...] Pro Tweets       James Coglan has released updates to JS.Class and Helium. <a href="http://blog.jcoglan.com/2010/03/09/js-class-and-helium-updates/" rel="nofollow">http://blog.jcoglan.com/2010/03/09/js-class-and-helium-updates/</a>       dalmaer  &#8211; Wed 10 Mar 7:31                           All Things [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on What are you doing with Sylvester? by Zoltan Hawryluk</title>
		<link>http://blog.jcoglan.com/2007/11/28/what-are-you-doing-with-sylvester/comment-page-1/#comment-4297</link>
		<dc:creator>Zoltan Hawryluk</dc:creator>
		<pubDate>Tue, 09 Mar 2010 11:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/2007/11/28/what-are-you-doing-with-sylvester/#comment-4297</guid>
		<description>I have been using Sylvester do make &lt;a href=&quot;http://www.w3.org/TR/css3-2d-transforms/&quot; rel=&quot;nofollow&quot;&gt;CSS3 transform property&lt;/a&gt; work in Internet Explorer 6+ like it does in the other top browsers.  Sylvester has &lt;strong&gt;really&lt;/strong&gt; shortened the amount of development work and I thank you. 

If you are interested in the result of my work, please see my article, &lt;a href=&quot;http://www.useragentman.com/blog/2010/03/09/cross-browser-css-transforms-even-in-ie/&quot; rel=&quot;nofollow&quot;&gt;Cross Browser CSS Transforms – even in IE&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>I have been using Sylvester do make <a href="http://www.w3.org/TR/css3-2d-transforms/" rel="nofollow">CSS3 transform property</a> work in Internet Explorer 6+ like it does in the other top browsers.  Sylvester has <strong>really</strong> shortened the amount of development work and I thank you. </p>
<p>If you are interested in the result of my work, please see my article, <a href="http://www.useragentman.com/blog/2010/03/09/cross-browser-css-transforms-even-in-ie/" rel="nofollow">Cross Browser CSS Transforms – even in IE</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Evented programming patterns: Round-up by James Coglan</title>
		<link>http://blog.jcoglan.com/2010/02/26/evented-programming-patterns-round-up/comment-page-1/#comment-4281</link>
		<dc:creator>James Coglan</dc:creator>
		<pubDate>Thu, 04 Mar 2010 00:44:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=623#comment-4281</guid>
		<description>Thanks for the correction, Brent. I&#039;ve updated the article to reflect your suggestion. I usually use &lt;tt&gt;Array#forEach&lt;/tt&gt; which stops such problems from happening, but thought I should use JavaScript common to all browsers for these examples. A good illustration of how useful closures can be!</description>
		<content:encoded><![CDATA[<p>Thanks for the correction, Brent. I&#8217;ve updated the article to reflect your suggestion. I usually use <tt>Array#forEach</tt> which stops such problems from happening, but thought I should use JavaScript common to all browsers for these examples. A good illustration of how useful closures can be!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Evented programming patterns: Round-up by Brent Lintner</title>
		<link>http://blog.jcoglan.com/2010/02/26/evented-programming-patterns-round-up/comment-page-1/#comment-4278</link>
		<dc:creator>Brent Lintner</dc:creator>
		<pubDate>Wed, 03 Mar 2010 20:33:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=623#comment-4278</guid>
		<description>Great set of posts! 

One thing I wanted to mention was that using your recommended approach of setTimeout(func, 0); does not work properly.

The &#039;i&#039; variable gets closured properly but in the context of setTimeout function, it is still being changed by the for loop. So essentially all the callbacks throw errors as &#039;i&#039; is still changing and will most likely be equal to listeners.length.

We remedied this by wrapping the setTimeout function argument in its own auto invoked function as declared below.

&lt;pre&gt;&lt;code&gt;    setTimeout(function(x){
        return(function(){
            // code here using x
        });
    }(i), 0);&lt;/code&gt;&lt;/pre&gt;

Cheers,

Brent.</description>
		<content:encoded><![CDATA[<p>Great set of posts! </p>
<p>One thing I wanted to mention was that using your recommended approach of setTimeout(func, 0); does not work properly.</p>
<p>The &#8216;i&#8217; variable gets closured properly but in the context of setTimeout function, it is still being changed by the for loop. So essentially all the callbacks throw errors as &#8216;i&#8217; is still changing and will most likely be equal to listeners.length.</p>
<p>We remedied this by wrapping the setTimeout function argument in its own auto invoked function as declared below.</p>
<pre><code>    setTimeout(function(x){
        return(function(){
            // code here using x
        });
    }(i), 0);</code></pre>
<p>Cheers,</p>
<p>Brent.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Faye: a Comet client and server for Node.js and Rack by Kamil Trebunia</title>
		<link>http://blog.jcoglan.com/2010/02/02/faye-a-comet-client-and-server-for-node-js-and-rack/comment-page-1/#comment-4274</link>
		<dc:creator>Kamil Trebunia</dc:creator>
		<pubDate>Tue, 02 Mar 2010 17:02:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=526#comment-4274</guid>
		<description>Works flawlessly so far, great job, thank you!</description>
		<content:encoded><![CDATA[<p>Works flawlessly so far, great job, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Faye: a Comet client and server for Node.js and Rack by James Coglan</title>
		<link>http://blog.jcoglan.com/2010/02/02/faye-a-comet-client-and-server-for-node-js-and-rack/comment-page-1/#comment-4267</link>
		<dc:creator>James Coglan</dc:creator>
		<pubDate>Mon, 01 Mar 2010 16:39:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=526#comment-4267</guid>
		<description>I have implemented server-side clients that can publish and subscribe, they&#039;ve just not been released yet. Hopefully I&#039;ll get them released this week, in the meantime there&#039;s information in the README on GitHub, for example under Node you&#039;d do:

&lt;pre&gt;&lt;code&gt;// Remote client
client = new Faye.Client(&#039;http://example.com/faye&#039;);

// Local client
server = new Faye.NodeAdapter(options);
client = server.getClient();&lt;/code&gt;&lt;/pre&gt;

And use the client just like you would in a browser.</description>
		<content:encoded><![CDATA[<p>I have implemented server-side clients that can publish and subscribe, they&#8217;ve just not been released yet. Hopefully I&#8217;ll get them released this week, in the meantime there&#8217;s information in the README on GitHub, for example under Node you&#8217;d do:</p>
<pre><code>// Remote client
client = new Faye.Client('http://example.com/faye');

// Local client
server = new Faye.NodeAdapter(options);
client = server.getClient();</code></pre>
<p>And use the client just like you would in a browser.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Faye: a Comet client and server for Node.js and Rack by Kamil Trebunia</title>
		<link>http://blog.jcoglan.com/2010/02/02/faye-a-comet-client-and-server-for-node-js-and-rack/comment-page-1/#comment-4266</link>
		<dc:creator>Kamil Trebunia</dc:creator>
		<pubDate>Mon, 01 Mar 2010 16:31:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=526#comment-4266</guid>
		<description>Hello James, have looked through commit history and it seems to me that you did not yet implemented a way to invoke publish() on server side yet, am I right?</description>
		<content:encoded><![CDATA[<p>Hello James, have looked through commit history and it seems to me that you did not yet implemented a way to invoke publish() on server side yet, am I right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Evented programming patterns: Round-up by Какво ново в последната седмица на Февуари &#124; NeXt</title>
		<link>http://blog.jcoglan.com/2010/02/26/evented-programming-patterns-round-up/comment-page-1/#comment-4261</link>
		<dc:creator>Какво ново в последната седмица на Февуари &#124; NeXt</dc:creator>
		<pubDate>Sun, 28 Feb 2010 12:51:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=623#comment-4261</guid>
		<description>[...] Evented programming patterns: Round-up: Всъщност това е серия от пет много добри постове. [...]</description>
		<content:encoded><![CDATA[<p>[...] Evented programming patterns: Round-up: Всъщност това е серия от пет много добри постове. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Evented programming patterns: Asynchronous methods by Brent Lintner</title>
		<link>http://blog.jcoglan.com/2010/02/24/evented-programming-patterns-asynchronous-methods/comment-page-1/#comment-4244</link>
		<dc:creator>Brent Lintner</dc:creator>
		<pubDate>Fri, 26 Feb 2010 00:57:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=602#comment-4244</guid>
		<description>Very intriguing and thought invoking post!</description>
		<content:encoded><![CDATA[<p>Very intriguing and thought invoking post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Evented programming patterns: Asynchronous methods by John Nunemaker</title>
		<link>http://blog.jcoglan.com/2010/02/24/evented-programming-patterns-asynchronous-methods/comment-page-1/#comment-4242</link>
		<dc:creator>John Nunemaker</dc:creator>
		<pubDate>Thu, 25 Feb 2010 04:14:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=602#comment-4242</guid>
		<description>Stellar write ups thus far James. Why stop at one week? Lets keep articles like this rolling. :)</description>
		<content:encoded><![CDATA[<p>Stellar write ups thus far James. Why stop at one week? Lets keep articles like this rolling. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Events: they&#8217;re not just for the DOM, you know by Mike Rumble</title>
		<link>http://blog.jcoglan.com/2010/02/21/events-theyre-not-just-for-the-dom-you-know/comment-page-1/#comment-4227</link>
		<dc:creator>Mike Rumble</dc:creator>
		<pubDate>Mon, 22 Feb 2010 19:30:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=533#comment-4227</guid>
		<description>@Tobie, thanks for the info - wasn&#039;t so much referring to the implementation details, but more to the fact that the API exposed by Prototype, by default only allows custom events on DOM elements.

The approach of using the &#039;document&#039; is a neat one, and I&#039;ve seen a mixin you created a while back (http://gist.github.com/204012) that does just that. Would love to have this kind of functionality rolled in to Prototype&#039;s core.</description>
		<content:encoded><![CDATA[<p>@Tobie, thanks for the info &#8211; wasn&#8217;t so much referring to the implementation details, but more to the fact that the API exposed by Prototype, by default only allows custom events on DOM elements.</p>
<p>The approach of using the &#8216;document&#8217; is a neat one, and I&#8217;ve seen a mixin you created a while back (<a href="http://gist.github.com/204012" rel="nofollow">http://gist.github.com/204012</a>) that does just that. Would love to have this kind of functionality rolled in to Prototype&#8217;s core.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Events: they&#8217;re not just for the DOM, you know by James Coglan</title>
		<link>http://blog.jcoglan.com/2010/02/21/events-theyre-not-just-for-the-dom-you-know/comment-page-1/#comment-4221</link>
		<dc:creator>James Coglan</dc:creator>
		<pubDate>Mon, 22 Feb 2010 11:31:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=533#comment-4221</guid>
		<description>Thanks for the reminder about Dean&#039;s article, it&#039;s definitely worth a read. I may amend the first article I&#039;ve drafted to cover robustness, or leave concerns like that for a final round-up piece on the all the patterns I&#039;ll cover. I want to keep the initial implementation examples really simple to communicate the basic ideas in a fairly language-neutral way.</description>
		<content:encoded><![CDATA[<p>Thanks for the reminder about Dean&#8217;s article, it&#8217;s definitely worth a read. I may amend the first article I&#8217;ve drafted to cover robustness, or leave concerns like that for a final round-up piece on the all the patterns I&#8217;ll cover. I want to keep the initial implementation examples really simple to communicate the basic ideas in a fairly language-neutral way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Events: they&#8217;re not just for the DOM, you know by Tobie Langel</title>
		<link>http://blog.jcoglan.com/2010/02/21/events-theyre-not-just-for-the-dom-you-know/comment-page-1/#comment-4220</link>
		<dc:creator>Tobie Langel</dc:creator>
		<pubDate>Mon, 22 Feb 2010 11:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jcoglan.com/?p=533#comment-4220</guid>
		<description>Great article, James.

Mike, for the record, any true event handling system written in JavaScript will need to rely on host objects for error handling (you don&#039;t want an error thrown by an event handler to stop the event being dispatched to the other event handlers). Dean Edwards wrote a great article on the subject a while back: http://dean.edwards.name/weblog/2009/03/callbacks-vs-events/

Prototype&#039;s event model uses the DOM, other systems will rely on `setTimeout` to call handlers. Either way, you&#039;re bound to the browser environment.

That said, if you consider the `document` object as as the broker in a publisher/subscriber pattern, you can very well use Prototype&#039;s custom event system outside of the DOM.</description>
		<content:encoded><![CDATA[<p>Great article, James.</p>
<p>Mike, for the record, any true event handling system written in JavaScript will need to rely on host objects for error handling (you don&#8217;t want an error thrown by an event handler to stop the event being dispatched to the other event handlers). Dean Edwards wrote a great article on the subject a while back: <a href="http://dean.edwards.name/weblog/2009/03/callbacks-vs-events/" rel="nofollow">http://dean.edwards.name/weblog/2009/03/callbacks-vs-events/</a></p>
<p>Prototype&#8217;s event model uses the DOM, other systems will rely on `setTimeout` to call handlers. Either way, you&#8217;re bound to the browser environment.</p>
<p>That said, if you consider the `document` object as as the broker in a publisher/subscriber pattern, you can very well use Prototype&#8217;s custom event system outside of the DOM.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
