<?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: Rack API is awkward</title>
	<atom:link href="http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/feed/" rel="self" type="application/rss+xml" />
	<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/</link>
	<description>The act of making love, tenderly.</description>
	<lastBuildDate>Mon, 07 May 2012 22:50:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Konstantin Haase</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-136227</link>
		<dc:creator>Konstantin Haase</dc:creator>
		<pubDate>Tue, 31 May 2011 09:44:14 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-136227</guid>
		<description>The Rack::Runtime issue is unfixable, even if you use buckets and filters, as it is setting a header and the idea of your streaming approach is getting data out while generating. Since headers come first it is impossible to track processing time in there.</description>
		<content:encoded><![CDATA[<p>The Rack::Runtime issue is unfixable, even if you use buckets and filters, as it is setting a header and the idea of your streaming approach is getting data out while generating. Since headers come first it is impossible to track processing time in there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konstantin Haase</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-136127</link>
		<dc:creator>Konstantin Haase</dc:creator>
		<pubDate>Sun, 29 May 2011 13:04:51 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-136127</guid>
		<description>I would love to start working on a Rack alternative (as mentioned in your keynote). Do you have any plans for this or the code you used around somewhere?

Konstantin</description>
		<content:encoded><![CDATA[<p>I would love to start working on a Rack alternative (as mentioned in your keynote). Do you have any plans for this or the code you used around somewhere?</p>
<p>Konstantin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Firebaugh</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-133975</link>
		<dc:creator>John Firebaugh</dc:creator>
		<pubDate>Wed, 06 Apr 2011 23:02:27 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-133975</guid>
		<description>Properly formatted code here: https://gist.github.com/906721</description>
		<content:encoded><![CDATA[<p>Properly formatted code here: <a href="https://gist.github.com/906721" rel="nofollow">https://gist.github.com/906721</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Firebaugh</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-133974</link>
		<dc:creator>John Firebaugh</dc:creator>
		<pubDate>Wed, 06 Apr 2011 23:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-133974</guid>
		<description>Imagine an alternative Rack specification in which the [status, headers, body] tuple was _yielded_ rather than returned.

    class ResponseTimer
      def call(env, &amp;block)
        now = Time.now
        @app.call(env, &amp;block)
        $stderr.puts({&#039;X-Response-Took&#039; =&gt; (Time.now - now)})
      end
    end

    class FakeRack
      def serve(application)
        application.call({}) do &#124;status, headers, body&#124;
          p :status  =&gt; status
          p :headers =&gt; headers
          
          body.each do &#124;string&#124;
            p string
          end
          
          body.close if body.respond_to?(:close)
        end
      end
    end

Wouldn&#039;t this be a clean solution?</description>
		<content:encoded><![CDATA[<p>Imagine an alternative Rack specification in which the [status, headers, body] tuple was _yielded_ rather than returned.</p>
<p>    class ResponseTimer<br />
      def call(env, &amp;block)<br />
        now = Time.now<br />
        @app.call(env, &amp;block)<br />
        $stderr.puts({&#8216;X-Response-Took&#8217; =&gt; (Time.now &#8211; now)})<br />
      end<br />
    end</p>
<p>    class FakeRack<br />
      def serve(application)<br />
        application.call({}) do |status, headers, body|<br />
          p :status  =&gt; status<br />
          p :headers =&gt; headers</p>
<p>          body.each do |string|<br />
            p string<br />
          end</p>
<p>          body.close if body.respond_to?(:close)<br />
        end<br />
      end<br />
    end</p>
<p>Wouldn&#8217;t this be a clean solution?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Taking Stock of JRuby Web Servers &#124; Engine Yard Ruby on Rails Blog</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-133336</link>
		<dc:creator>Taking Stock of JRuby Web Servers &#124; Engine Yard Ruby on Rails Blog</dc:creator>
		<pubDate>Thu, 24 Mar 2011 17:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-133336</guid>
		<description>[...] and JRuby-Rack will flush each element of the response body individually. (A word of caution: Aaron Patterson reports how the Rack API doesn&#8217;t support this very well, so make sure you know what you&#8217;re [...]</description>
		<content:encoded><![CDATA[<p>[...] and JRuby-Rack will flush each element of the response body individually. (A word of caution: Aaron Patterson reports how the Rack API doesn&#8217;t support this very well, so make sure you know what you&#8217;re [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme Silveira</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-132454</link>
		<dc:creator>Guilherme Silveira</dc:creator>
		<pubDate>Tue, 08 Mar 2011 13:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-132454</guid>
		<description>Yep. The optional trailer header fields. They need to be either safely ignored (by intermediates, for example) or required explicitely by the clients (which might not get it back, even if supporting it).

For the proposed case (calculating the content-length) it would still incur in caching the result prior to sending the response, as the content-length for each chunk is required prior to the chunk itself. But that is probably a hard to solve problem: telling others how many bytes you are going to send before knowing the bytes themselves. (unless you have cached them...)

Regards</description>
		<content:encoded><![CDATA[<p>Yep. The optional trailer header fields. They need to be either safely ignored (by intermediates, for example) or required explicitely by the clients (which might not get it back, even if supporting it).</p>
<p>For the proposed case (calculating the content-length) it would still incur in caching the result prior to sending the response, as the content-length for each chunk is required prior to the chunk itself. But that is probably a hard to solve problem: telling others how many bytes you are going to send before knowing the bytes themselves. (unless you have cached them&#8230;)</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-132393</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 07 Mar 2011 03:13:59 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-132393</guid>
		<description>@Guilherme - Presumably referring to this: &quot;The trailer allows the sender to include additional HTTP header fields at the end of the message&quot; http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1</description>
		<content:encoded><![CDATA[<p>@Guilherme &#8211; Presumably referring to this: &#8220;The trailer allows the sender to include additional HTTP header fields at the end of the message&#8221; <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1" rel="nofollow">http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Weber</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-132383</link>
		<dc:creator>Greg Weber</dc:creator>
		<pubDate>Sun, 06 Mar 2011 22:51:57 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-132383</guid>
		<description>You may be interested in the web application interface used for the haskell programming language called WAI: http://docs.yesodweb.com/book/wai

Definitely inspired by Rack- actually the first haskell web application interface was called hack, and included all the same performance problems as Rack. A WAI response is fundamentally streaming based.</description>
		<content:encoded><![CDATA[<p>You may be interested in the web application interface used for the haskell programming language called WAI: <a href="http://docs.yesodweb.com/book/wai" rel="nofollow">http://docs.yesodweb.com/book/wai</a></p>
<p>Definitely inspired by Rack- actually the first haskell web application interface was called hack, and included all the same performance problems as Rack. A WAI response is fundamentally streaming based.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guilherme Silveira</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-132379</link>
		<dc:creator>Guilherme Silveira</dc:creator>
		<pubDate>Sun, 06 Mar 2011 21:54:11 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-132379</guid>
		<description>Footer fields? Can you point us out where they are?

Spec 1.1 seems not to have it:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4

Regards</description>
		<content:encoded><![CDATA[<p>Footer fields? Can you point us out where they are?</p>
<p>Spec 1.1 seems not to have it:<br />
<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4" rel="nofollow">http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4</a></p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Cribbs</title>
		<link>http://tenderlovemaking.com/2011/03/03/rack-api-is-awkward/comment-page-1/#comment-132340</link>
		<dc:creator>Sean Cribbs</dc:creator>
		<pubDate>Sat, 05 Mar 2011 17:10:20 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=522#comment-132340</guid>
		<description>Interestingly, the HTTP spec allows Footer fields, but I don&#039;t know any webserver that implements them or any client that understands them.</description>
		<content:encoded><![CDATA[<p>Interestingly, the HTTP spec allows Footer fields, but I don&#8217;t know any webserver that implements them or any client that understands them.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

