Rainbows! Rack HTTP server user/dev discussion
 help / Atom feed
From: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
To: Rainbows! list <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: Sinatra stream(:keep_open) not holding connections open
Date: Wed, 5 Dec 2012 01:44:54 +0000
Message-ID: <20121205014454.GA24401@dcvr.yhbt.net> (raw)
In-Reply-To: <CA+-9oNeKevgZOvKUPs-3VF7qstn8BcNw3_Py0M50h-j5-GzvOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

"W. Andrew Loe III" <andrew-4trK/3dDa6Nl57MIdRCFDg@public.gmane.org> 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


  parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05  1:19 W. Andrew Loe III
     [not found] ` <CA+-9oNeKevgZOvKUPs-3VF7qstn8BcNw3_Py0M50h-j5-GzvOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-05  1:44   ` Eric Wong [this message]
     [not found]     ` <20121205014454.GA24401-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2012-12-05  2:16       ` W. Andrew Loe III
     [not found]         ` <CA+-9oNd1EFqsniPkkPTwu5opTCinbM7-2KHoXov7+y3LE4s4Tg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-05  3:18           ` Eric Wong
     [not found]             ` <20121205031848.GA32757-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2012-12-05  6:09               ` W. Andrew Loe III
     [not found]                 ` <CA+-9oNfR9zM4phTShBsyjweAZBBYWF5egHw7MU8gcBf3f=fAJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-19  0:21                   ` W. Andrew Loe III
     [not found]                     ` <CA+-9oNdXyYrnyu3dfMuu7ULE7rhT_Rm48BCU_KaJUwsrmcj9-g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-19  1:01                       ` W. Andrew Loe III
     [not found]                         ` <CA+-9oNedbb17X=6Eum0bOG3zEryrhnurvXui4Ye7TcRLrAFcUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-19  1:09                           ` Eric Wong

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://bogomips.org/rainbows/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121205014454.GA24401@dcvr.yhbt.net \
    --to=normalperson-rmlxzr9ms24@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Rainbows! Rack HTTP server user/dev discussion

Archives are clonable:
	git clone --mirror https://bogomips.org/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rainbows
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.rainbows

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox