Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
To: James Tucker <jftucker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
Subject: Re: Single Threaded Async Responses
Date: Mon, 5 Oct 2009 15:56:33 -0700	[thread overview]
Message-ID: <20091005225633.GA23138@dcvr.yhbt.net> (raw)
In-Reply-To: <0956CE27-14FE-42DF-BAD9-CED31B09D85D-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

James Tucker <jftucker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Eric and anyone else listening in,
> I completed an async API for Thin quite some time ago well suited to  
> some of the design goals you have here. If you're interested we could  
> have a chat about supporting the same API designs that allow single  
> threaded reactor based concurrent responses. I believe such an API would 
> fit well in rainbows too.

Hi James,

This sounds interesting.

Does this mean it does synchronous request reading?  That'll mean
it requires nginx in front to work well.

So the response is written asynchronously, meaning it can be bigger than
the outgoing TCP buffers and still not block, right?  I considered
something like this for Unicorn, too, but then I realised that all the
responses I see managed to fit into the TCP buffers without blocking

But for weird OSes with tiny buffers or apps dealing with large
responses it would probably make sense for Rainbows! (especially
if you plan to help me support it into the future :)

Is it merged into Thin already?  Where can/should I take a look?

One bit to be careful for is the body of the Rack response may not be a
simple Array of String objects, so that requires extra effort/cycles to
stringify into something that can be buffered for async writes.  But
then that could be a huge chunk to keep around in memory (since we
mainly need this to support larger responses).  What nginx does is
it will buffer into a temporary file and then sendfile() it over
as the socket becomes readable.

Eric Wong

  parent reply	other threads:[~2009-10-05 22:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 22:10 Single Threaded Async Responses James Tucker
     [not found] ` <0956CE27-14FE-42DF-BAD9-CED31B09D85D-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-10-05 22:56   ` Eric Wong [this message]
2009-10-19 18:33   ` Eric Wong

Reply instructions:

You may reply publicly 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:

  List information: https://yhbt.net/rainbows/

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

  git send-email \
    --in-reply-to=20091005225633.GA23138@dcvr.yhbt.net \
    --to=normalperson-rmlxzr9ms24@public.gmane.org \
    --cc=jftucker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).