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 18:16:15 -0800 Message-ID: References: <20121205014454.GA24401@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 1354673786 27108 80.91.229.3 (5 Dec 2012 02:16:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2012 02:16:26 +0000 (UTC) To: "Rainbows! list" Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Wed Dec 05 03:16:37 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=ITH4enjUR/CVp2T1kBgqIe4pjDcmtZbs7T/qJt38rTM=; b=XX6DjoJIAu1SbmXn+0wlDROohwKnQ1GSexlaCZnEag4SRnjxPV5J0cYpyL0Pzk6eKs dqkaXhoI3DJgMZkEiRrh5sjOC1dsUvDFeKw48xUU8e0zr1i/pC/aw7BvLtEdg1301LGH pJqJO9Bf/0nYeg+xAmFs8lChgyHIxo6BByW2I= 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=ITH4enjUR/CVp2T1kBgqIe4pjDcmtZbs7T/qJt38rTM=; b=frHdHLJUqjytRsOce5n6KX1MAcyBC+a7BKhDAjsQHUHfFSrhnju1bGJ3I+PQv359fu 07yLX+DYQR6orYnaISOnS9n9XO93F+QDo98jxz0W30ctjycCUUNo5atDD6Md5yUe2I4E /cz2IJTeFv/mbWZQtjO663pe+LpqatFxz+EIXTD20eucv6x35qtBjGrd4xh9Bs0KlTN+ 3P6KhWyxXqcnme6eaJYIWMUzq8S7HBJ8aZAcRnzNzU2bqwE5ZvNNQLpktEbUCLCPpBKh Tqk5dW8s/rRsSahgmiSFzMA9NhXVyTO7f8FfUWdoU5STlFESzB4Qn7GHMpHA9hvPbqAK VZJg== X-Originating-IP: [67.170.49.236] In-Reply-To: <20121205014454.GA24401-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> X-Gm-Message-State: ALoCoQlmazZSCJuA6zT5M6TD+Q2RAVxOoi0j0PC2fYCFF7ZHAy+c/IAP0svOzJ5OI/qI+eepao6o 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:416 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 1Tg4XM-0004RO-SA for gclrrg-rainbows-talk@m.gmane.org; Wed, 05 Dec 2012 03:16:37 +0100 Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 9C4202E077; Wed, 5 Dec 2012 02:16:21 +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 7C3A42E077 for ; Wed, 5 Dec 2012 02:16:16 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id x16so4752954vcq.23 for ; Tue, 04 Dec 2012 18:16:16 -0800 (PST) Received: by 10.220.231.8 with SMTP id jo8mr13613455vcb.40.1354673775940; Tue, 04 Dec 2012 18:16:15 -0800 (PST) Received: by 10.58.147.101 with HTTP; Tue, 4 Dec 2012 18:16:15 -0800 (PST) I've pushed a very very stripped down example that just echos the time. https://github.com/loe/sinatra-sse $ bundle install $ foreman start rainbows $ foreman start thin Rainbows listens on 5000 and hangs up immediately. Thin listens on 5001 and keeps the connection open, you'll see the time in your browser. On Tue, Dec 4, 2012 at 5:44 PM, Eric Wong wrote: > "W. Andrew Loe III" wrote: >> I'm running Rainbows with EventMachine and struggling to get it to >> keep the connections open. >> >> First, here is my code: https://gist.github.com/c33598db8a113b574165 > > I'll take a closer look later today. > > Can you use a public gist (or any other public git repo) instead of a > private one? Private gists make no sense for public bug reports. > >> This application works on Thin. >> >> The main loop handles the HTTP request and creates a Celluloid Actor >> that hangs out waiting on messages from Redis, when it receives a >> message it dispatches it to the stream which EM then pushes out to the >> client. Eventually the client will disconnect (this is Server-Sent >> Events) and the Actor is torn down. > > Can you reproduce the issue with a stripped down application that > does not depend on Redis? How about one that does not depend on > Celluloid? > >> I want to run under Rainbows! for the hot upgrades and to re-use all >> of the wonderful scripts I have for managing my Rails/Unicorn stack. >> What I see is the GET handler executed, the Actor spawned, then the >> connection is closed and the Actor is terminated. The browser then >> reconnects. It doesn't ever have the opportunity to dispatch a message >> the Actor doesn't even connect to Redis before it is terminated. >> Response times are something like 0.0011 seconds, nothing is being >> done. >> >> I'd prefer not to pull in Sinatra::Async, I'd like to know why it >> works with Thin out-of-the-box, but not Rainbows! > > I would too! I wasn't aware of stream(:keep_open) until now. > I'll check it out soon. > _______________________________________________ > 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