<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>macournoyer - Latest Comments in Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.disqus.com/</link><description>Marc-André Cournoyer's blog</description><atom:link href="https://macournoyer.disqus.com/pusher_amp_async_with_thin_macournoyers_blog/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Sat, 11 Dec 2010 16:26:08 -0000</lastBuildDate><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-110373982</link><description>&lt;p&gt;It's now a gem &lt;a href="https://github.com/macournoyer/thin_async" rel="nofollow noopener" target="_blank" title="https://github.com/macournoyer/thin_async"&gt;https://github.com/macourno...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">macournoyer</dc:creator><pubDate>Sat, 11 Dec 2010 16:26:08 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-110234031</link><description>&lt;p&gt;Thx for the writeup, but why is AsyncResponse not defined in the Thin webserver. Why do i have to define it myself?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vincent Landgraf</dc:creator><pubDate>Sat, 11 Dec 2010 03:18:55 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-19735955</link><description>&lt;p&gt;great, thanks for the sinatra add on... &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mattkaufman</dc:creator><pubDate>Sat, 10 Oct 2009 09:19:33 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-16684422</link><description>&lt;p&gt;pop into #eventmachine on freenode sometime, we can probably help you out&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">raggi</dc:creator><pubDate>Tue, 15 Sep 2009 19:34:55 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-16673994</link><description>&lt;p&gt;I am using a modified deferrable body, the issue I'm running into is I don't want to return a standard [status, headers, deferrable_body] response.&lt;/p&gt;&lt;p&gt;With my proxy I want to play the "remote" response back directly over the "local" request.&lt;/p&gt;&lt;p&gt;My rack handler looks like this:&lt;/p&gt;&lt;p&gt;def call(env)&lt;br&gt;  request = Rack::&lt;a href="http://Request.new" rel="nofollow noopener" target="_blank" title="Request.new"&gt;Request.new&lt;/a&gt;&lt;br&gt;  # using a modified  DeferrableBody so I can control the callback used.&lt;br&gt;  socket = EM.connect &lt;a href="http://request.host" rel="nofollow noopener" target="_blank" title="request.host"&gt;request.host&lt;/a&gt;, request.port, RequestProxy, DeferrableBody(@env['async.chunk_callback'])&lt;br&gt;  socket.send_data @env['http.request_body'] # plain, unparsed FULL http request&lt;br&gt;end&lt;/p&gt;&lt;p&gt;class TCPSocketProxy &amp;lt; EventMachine::Connection&lt;br&gt;  def initialize socket # socket is the async chunk callback&lt;br&gt;    @socket = socket&lt;br&gt;  end&lt;/p&gt;&lt;p&gt;  def recieve_data data&lt;br&gt;    @socket.call data&lt;br&gt;    #&lt;br&gt;    EM.next_tick { close_conncetion } if finished?&lt;br&gt;  end&lt;/p&gt;&lt;p&gt;  def unbind&lt;br&gt;    @socket.succeed&lt;br&gt;  end&lt;/p&gt;&lt;p&gt;  def finished?&lt;br&gt;    # I have implementations of these, but need to redo them with a proper HTTPResponse parser&lt;br&gt;    return false unless headers_recieved?&lt;br&gt;    return true if not_modified?&lt;br&gt;    return false unless content_length&lt;br&gt;    return true if body_length = content_length&lt;br&gt;  end&lt;br&gt;end&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">collintmiller</dc:creator><pubDate>Tue, 15 Sep 2009 17:43:11 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-16618035</link><description>&lt;p&gt;Use a deferrable body?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">raggi</dc:creator><pubDate>Tue, 15 Sep 2009 04:24:36 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-16602811</link><description>&lt;p&gt;I've been doing more with this callback lately and I've found a use-case that I couldn't figure out how to do without a modification to Thin.&lt;/p&gt;&lt;p&gt;&lt;a href="http://gist.github.com/187018" rel="nofollow noopener" target="_blank" title="http://gist.github.com/187018"&gt;http://gist.github.com/187018&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I'm using rack to build an http proxy. The proxy works rougly like this:&lt;/p&gt;&lt;p&gt;Request comes in.&lt;br&gt;Open Socket to the host and port of the Request.&lt;br&gt;Replay entire Request Body onto Socket.&lt;br&gt;As data comes back over Socket, write to Request's Async Chunk Callback.&lt;/p&gt;&lt;p&gt;Any thoughts about better ways to do this?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">collintmiller</dc:creator><pubDate>Mon, 14 Sep 2009 20:33:49 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-16257706</link><description>&lt;p&gt;Awesome writeup Marc :-)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">raggi</dc:creator><pubDate>Wed, 09 Sep 2009 11:34:32 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-11970549</link><description>&lt;p&gt;@macournoyer&lt;/p&gt;&lt;p&gt;:) Awesome. This post and the resources linked to within have proven invaluable :)&lt;/p&gt;&lt;p&gt;&lt;a href="http://github.com/collin/orbited-ruby/tree/master" rel="nofollow noopener" target="_blank" title="http://github.com/collin/orbited-ruby/tree/master"&gt;http://github.com/collin/or...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Have it almost working with the existing Orbited client code :)&lt;/p&gt;&lt;p&gt;Anybody have a notion of when we can expect to have a unified asynchronous callback api in Rack? Thin is nice, but it'd be even nicer if more rack servers could be expected to run this stuff.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">collintmiller</dc:creator><pubDate>Wed, 01 Jul 2009 04:34:24 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-11710469</link><description>&lt;p&gt;Hey Collin, that looks like a really cool project!&lt;br&gt;Of course fell free to use DeferrableBody. I stole it from raggi initially.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">macournoyer</dc:creator><pubDate>Wed, 24 Jun 2009 22:29:02 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-11708744</link><description>&lt;p&gt;Oh excellent!&lt;br&gt;Mind if I use your DeferrableBody code in &lt;a href="http://github.com/collin/orbited-ruby" rel="nofollow noopener" target="_blank" title="http://github.com/collin/orbited-ruby"&gt;http://github.com/collin/or...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">collintmiller</dc:creator><pubDate>Wed, 24 Jun 2009 21:14:06 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-10747257</link><description>&lt;p&gt;hey thx guys! glad you like it.&lt;/p&gt;&lt;p&gt;I fixed the typo.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">macournoyer</dc:creator><pubDate>Thu, 11 Jun 2009 14:32:12 -0000</pubDate></item><item><title>Re: Pusher &amp;amp; Async With Thin
      -
      macournoyer's blog</title><link>http://macournoyer.com/blog/2009/06/04/pusher-and-async-with-thin/#comment-10744178</link><description>&lt;p&gt;Thanks for the writeup!&lt;/p&gt;&lt;p&gt;There is a typo:&lt;/p&gt;&lt;p&gt;EM.next_tick dp&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">superjared</dc:creator><pubDate>Thu, 11 Jun 2009 13:21:24 -0000</pubDate></item></channel></rss>