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: Sinatra stream(:keep_open) not holding connections open Date: Tue, 4 Dec 2012 17:19:28 -0800 Message-ID: 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 1354670730 4309 80.91.229.3 (5 Dec 2012 01:25:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2012 01:25:30 +0000 (UTC) To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Wed Dec 05 02:25:43 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 X-Greylist: delayed 351 seconds by postgrey-1.31 at rubyforge; Wed, 05 Dec 2012 01:25:19 UTC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=andrewloe.com; s=google; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type; bh=IZ8w2DDOMTBpnD+kJEXNEqRVrEzmYoiXhOHeWB+MewA=; b=QQH5e4o6/D7WPoR+qckn3fgkVVSE7/OabGJ4IlwvsiNISxxOUw0CceN2CLbkgm0bk1 ImGEGKJtQA3GIwOai+bb+XXNafJCu6g85fRuR8WwJSc6flznegv74MiO/2IaZ+MPclSW k+cu+dO/tbBwRxacqwZ9R4ceT9j5I1js1Cxcw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=IZ8w2DDOMTBpnD+kJEXNEqRVrEzmYoiXhOHeWB+MewA=; b=ne84dHS+CogXtfVCoNY8tZ/8vJsTkH/aenvcLSKimOLxNbcB9YiHJYe2oGoyHf3PF2 v6B+riPCnrPFJ6qi1742TrO3Jy471j9iJUuzamlG5QXV1AEAP3sZ5+OVboT31dvC2WG8 z1Jo6EHCVBQBLsPFxPcxUCxLt/Hr7TnY1N1e4CoCV/PYut0JPtacQHZkN6Z2PCBRHLD+ SKt4yIDiYEH1VB7abwDe1nisI4Kbu9nd3Bg+21yRdy8FzQOjrFqo9hH4eAWMfvSvFL4u BiB5DE/3yLp6F2LIQOMS9o4CDxeffZNffs/1nJkmyfPIhJ+OiBf4oRw2EYBZAmgjLeAV 3CAw== X-Originating-IP: [66.171.181.62] X-Gm-Message-State: ALoCoQmH1wzFeM2NAbz9yoljLeYZPrNqg96c1jDFCrM+jVutmn+V1ZDMHpaGWG0Alzww/VdJZRhZ 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:414 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 1Tg3k0-0008Fl-Km for gclrrg-rainbows-talk@m.gmane.org; Wed, 05 Dec 2012 02:25:36 +0100 Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 1DE442E077; Wed, 5 Dec 2012 01:25:22 +0000 (UTC) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by rubyforge.org (Postfix) with ESMTP id 6E5C02E077 for ; Wed, 5 Dec 2012 01:25:19 +0000 (UTC) Received: by mail-vb0-f46.google.com with SMTP id b13so3669859vby.19 for ; Tue, 04 Dec 2012 17:25:19 -0800 (PST) Received: by 10.220.154.2 with SMTP id m2mr13495904vcw.18.1354670368659; Tue, 04 Dec 2012 17:19:28 -0800 (PST) Received: by 10.58.147.101 with HTTP; Tue, 4 Dec 2012 17:19:28 -0800 (PST) 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 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. 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! _______________________________________________ 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