<?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: Retrying code blocks in Ruby (on exceptions, whatever)</title>
	<atom:link href="http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/</link>
	<description>Rails, Firefox, Anime, Mac</description>
	<lastBuildDate>Thu, 11 Mar 2010 23:55:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: A Ruby &#8216;tries&#8217; method # Another code blog</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-731603</link>
		<dc:creator>A Ruby &#8216;tries&#8217; method # Another code blog</dc:creator>
		<pubDate>Thu, 15 Oct 2009 03:10:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-731603</guid>
		<description>[...] exercise.   Tj Holowaychuk posted a retry method, which appears itself to be a refactoring of the retryable [...]</description>
		<content:encoded><![CDATA[<p>[...] exercise.   Tj Holowaychuk posted a retry method, which appears itself to be a refactoring of the retryable [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loop Abstractions in D revisited</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-475634</link>
		<dc:creator>Loop Abstractions in D revisited</dc:creator>
		<pubDate>Thu, 31 Jan 2008 15:31:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-475634</guid>
		<description>[...] I showed you how we could make loop constructs abstract, in a similar way which is common in Ruby. The example I used as a model was the retryable method from Cheah Chu Yeow. His version is customizable in a way that let you [...]</description>
		<content:encoded><![CDATA[<p>[...] I showed you how we could make loop constructs abstract, in a similar way which is common in Ruby. The example I used as a model was the retryable method from Cheah Chu Yeow. His version is customizable in a way that let you [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: www.hans-eric.com &#187; Blog Archive &#187; Loop Abstractions in D</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-450580</link>
		<dc:creator>www.hans-eric.com &#187; Blog Archive &#187; Loop Abstractions in D</dc:creator>
		<pubDate>Thu, 17 Jan 2008 21:32:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-450580</guid>
		<description>[...] with Ruby is the natural way in which you can hide looping constructs with descriptive names. Like the retryable example that Cheah Chu Yeow gives on his [...]</description>
		<content:encoded><![CDATA[<p>[...] with Ruby is the natural way in which you can hide looping constructs with descriptive names. Like the retryable example that Cheah Chu Yeow gives on his [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chu Yeow</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-444102</link>
		<dc:creator>Chu Yeow</dc:creator>
		<pubDate>Tue, 15 Jan 2008 01:49:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-444102</guid>
		<description>You&#039;re right, Geoff and Jeremy! I wasn&#039;t aware the retry keyword worked for exceptions as well. I&#039;ve updated the code :).</description>
		<content:encoded><![CDATA[<p>You&#8217;re right, Geoff and Jeremy! I wasn&#8217;t aware the retry keyword worked for exceptions as well. I&#8217;ve updated the code :).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy McAnally</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-443695</link>
		<dc:creator>Jeremy McAnally</dc:creator>
		<pubDate>Mon, 14 Jan 2008 18:10:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-443695</guid>
		<description>The retry keyword works for exceptions also.  You could easily write a little helper to handle the retry counter, etc.</description>
		<content:encoded><![CDATA[<p>The retry keyword works for exceptions also.  You could easily write a little helper to handle the retry counter, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Buesing</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-443647</link>
		<dc:creator>Geoff Buesing</dc:creator>
		<pubDate>Mon, 14 Jan 2008 17:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-443647</guid>
		<description>I like this idea.

I think you could avoid the double yield in your implementation by using Ruby&#039;s &quot;retry&quot; method:

&lt;code&gt;
rescue SomeError
  tries -= 1
  retry if tries &gt; 0
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I like this idea.</p>
<p>I think you could avoid the double yield in your implementation by using Ruby&#8217;s &#8220;retry&#8221; method:</p>
<p><code><br />
rescue SomeError<br />
  tries -= 1<br />
  retry if tries &gt; 0<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macournoyer</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-443558</link>
		<dc:creator>macournoyer</dc:creator>
		<pubDate>Mon, 14 Jan 2008 14:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-443558</guid>
		<description>very nice, I like your retryable method!</description>
		<content:encoded><![CDATA[<p>very nice, I like your retryable method!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chu Yeow</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-443481</link>
		<dc:creator>Chu Yeow</dc:creator>
		<pubDate>Mon, 14 Jan 2008 12:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-443481</guid>
		<description>Yup exactly - I hated having to put conditionals in there for retries. Thankfully for Ruby blocks, we can abstract that considerably :)

That sounds really nice, if we could monkey patch &lt;code&gt;rescue&lt;/code&gt;, but I think it could be hard since &lt;code&gt;rescue&lt;/code&gt;&#039;s a language keyword.</description>
		<content:encoded><![CDATA[<p>Yup exactly &#8211; I hated having to put conditionals in there for retries. Thankfully for Ruby blocks, we can abstract that considerably :)</p>
<p>That sounds really nice, if we could monkey patch <code>rescue</code>, but I think it could be hard since <code>rescue</code>&#8217;s a language keyword.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rubylicio.us</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-443479</link>
		<dc:creator>rubylicio.us</dc:creator>
		<pubDate>Mon, 14 Jan 2008 12:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-443479</guid>
		<description>I ofcourse meant built into &quot;rescue&quot;, not &quot;retry&quot; in the above post.</description>
		<content:encoded><![CDATA[<p>I ofcourse meant built into &#8220;rescue&#8221;, not &#8220;retry&#8221; in the above post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rubylicio.us</title>
		<link>http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/comment-page-1/#comment-443478</link>
		<dc:creator>rubylicio.us</dc:creator>
		<pubDate>Mon, 14 Jan 2008 12:29:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2008/01/14/retrying-code-blocks-in-ruby-on-exceptions-whatever/#comment-443478</guid>
		<description>Good idea and nice little snippet, I usually tend to skip conditional retries, for no better reason then it feels like it clutters up my code alot ... which is a somewhat lame reason now that I think about it :)


Wonder if this could be built into &quot;retry&quot; itself somehow .. 

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;begin
  open(&#039;http://example.com/flaky_api&#039;)
rescue OpenURI::HTTPError, :retries =&gt; 5
  ## blah, errorreporting etc
end&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Good idea and nice little snippet, I usually tend to skip conditional retries, for no better reason then it feels like it clutters up my code alot &#8230; which is a somewhat lame reason now that I think about it :)</p>
<p>Wonder if this could be built into &#8220;retry&#8221; itself somehow .. </p>
<pre><code class="ruby">begin
  open('http://example.com/flaky_api')
rescue OpenURI::HTTPError, :retries =&gt; 5
  ## blah, errorreporting etc
end</code></pre>
]]></content:encoded>
	</item>
</channel>
</rss>
