From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=0.0 required=3.0 tests=MSGID_FROM_MTA_HEADER, TVD_RCVD_IP shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: "W. Andrew Loe III" Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: Sinatra stream(:keep_open) not holding connections open Date: Tue, 4 Dec 2012 22:09:53 -0800 Message-ID: References: <20121205014454.GA24401@dcvr.yhbt.net> <20121205031848.GA32757@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354687802 22841 80.91.229.3 (5 Dec 2012 06:10:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2012 06:10:02 +0000 (UTC) To: "Rainbows! list" Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Wed Dec 05 07:10:15 2012 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrewloe.com; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=DblaJoHXAezoLoptcl54yrTykEkxrLjTSsSMcNjfbno=; b=AeE9ES3lysF+VfWwQR6RTcRTVrusIDC8aKdiHQjgYJqTqdDBNRQCnZPzqwwO7XEs98 7h+EzCGzZjBlMag2q+6ZWa4FBexsMYpTCCnOSyzKIOd8RqicPpWEwJB9HLNFxRjCasiI ICIvXPP3gz1Udd0Gxw7k9412Xo3ZwlD5CS4BA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=DblaJoHXAezoLoptcl54yrTykEkxrLjTSsSMcNjfbno=; b=EUNZBuRwyT6WveRFGyv8cZNDeczv4/yL+AoBuRqYyCxVtkSFm6ByDASoHq/zH3Qpmj DWWdlfUAOR/Alhc18l3xdb2iD08vKaSVwbGcN4imyHd2bmD5s1tZUe1IkQmRTzof+gg0 fSaEVE556Uu8+6ufASDJSBpZJsGW8QKoMG6AC0eMwhLMbOX8Pyfag1zY9/0Rn7euX6Ln BMK7tTdIeXoJOjGiH48fV2je/QMzpA0fIuaJ5CoUPAIsmXsdMEa7hLKtM6X7wlSb7i1R 75mUyhqhefkIzRS0Nx5TSLSbQGkNQE6NiW+j8O7M08xIrzd9m/lvx2E0iFKHyWvxU88l xM8w== X-Originating-IP: [67.170.49.236] In-Reply-To: <20121205031848.GA32757-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> X-Gm-Message-State: ALoCoQmK1VAmCDEL0Cp8zBIsPVtKyMY0Aqd7mWBdQ3Er5ia/xTZd62oJN1d5sIKdLPE8BeakYo58 X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:418 Archived-At: Received: from 50-56-192-79.static.cloud-ips.com ([50.56.192.79] helo=rubyforge.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tg8BO-00083p-4T for gclrrg-rainbows-talk@m.gmane.org; Wed, 05 Dec 2012 07:10:10 +0100 Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 9D5922E07B; Wed, 5 Dec 2012 06:09:57 +0000 (UTC) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by rubyforge.org (Postfix) with ESMTP id 8B09E2E077 for ; Wed, 5 Dec 2012 06:09:54 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id x16so4940743vcq.23 for ; Tue, 04 Dec 2012 22:09:53 -0800 (PST) Received: by 10.220.231.8 with SMTP id jo8mr14101510vcb.40.1354687793706; Tue, 04 Dec 2012 22:09:53 -0800 (PST) Received: by 10.58.147.101 with HTTP; Tue, 4 Dec 2012 22:09:53 -0800 (PST) Works great! Thank you very much for the quick response and patch! Feature Request: https://github.com/celluloid/celluloid-io Celluloid::IO backend, the spiritual successor to cool.io. I'm going to take a stab at this soon, but wanted to get something out. On Tue, Dec 4, 2012 at 7:18 PM, Eric Wong wrote: > "W. Andrew Loe III" wrote: >> I've pushed a very very stripped down example that just echos the time. >> https://github.com/loe/sinatra-sse > > Thanks for the test case, I've just pushed out the following fix > to "master" of git://bogomips.org/rainbows.git > > I've pushed a rainbows 4.4.1.1.gd5c8c prerelease to RubyGems.org > It should be installable with: gem install --pre rainbows > > I expect this to work for you, but be sure to let me know if it doesn't :x > > Since this is a pretty small fix, I think I'll push 4.4.2 final > very soon. > > >From d5c8cc8b51619f0d33f75036c53e3936ad2749b2 Mon Sep 17 00:00:00 2001 > From: Eric Wong > Date: Wed, 5 Dec 2012 03:08:19 +0000 > Subject: [PATCH] event_machine: properly defer body.close for async > > Calling body.close in the normal write_response() code path > is incorrect, and only worked out of sheer luck with > Cramp and async_sinata. > > This change allows stream(:keep_open) in Sinatra to work > properly. > > Thanks to W. Andrew Loe III for the informative bug report > and reproducible test case. > > ref: http://mid.gmane.org/CA+-9oNd1EFqsniPkkPTwu5opTCinbM7-2KHoXov7+y3LE4s4Tg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org > --- > lib/rainbows/event_machine/client.rb | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/rainbows/event_machine/client.rb b/lib/rainbows/event_machine/client.rb > index e56931f..fc0dfe3 100644 > --- a/lib/rainbows/event_machine/client.rb > +++ b/lib/rainbows/event_machine/client.rb > @@ -64,8 +64,11 @@ class Rainbows::EventMachine::Client < EM::Connection > @state = :headers if alive > if body.respond_to?(:errback) && body.respond_to?(:callback) > @deferred = body > + write_headers(status, headers, alive) > + write_body_each(body) > deferred_errback(body) > deferred_callback(body, alive) > + return > elsif body.respond_to?(:to_path) > st = File.stat(path = body.to_path) > > -- > Eric Wong > _______________________________________________ > Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org > http://rubyforge.org/mailman/listinfo/rainbows-talk > Do not quote signatures (like this one) or top post when replying _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying