rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: rack-devel@googlegroups.com
Subject: Re: rational for rewind()
Date: Thu, 17 Jul 2014 23:44:05 +0000	[thread overview]
Message-ID: <20140717234405.GA24893@dcvr.yhbt.net> (raw)
In-Reply-To: <CABGa_T8mMGh57AkEAdFFoG19ms27DN-rp8ZRWw1AZ_RVDnjbhQ@mail.gmail.com>

James Tucker <jftucker@gmail.com> wrote:
> > Torsten Robitzki <Torsten@Robitzki.de> wrote:
> > > Hello,
> > > I'm implementing a C++ comet web server, that (tries) to implement rack
> > to
> > > adapt ruby applications. Currently I'm reading a body very naively put
> > the
> > > body into a ruby String and wrap it with a StringIO to provide the
> > > rack.input for the implementation. As I'm going to use the server for
> > > uploading images, I would like to implement a real, stream-like object to
> > > circumvent the need to buffer the POST body before handing it to the
> > > application.
> >
> > unicorn implements input like tee(1) doing lazy, rewindable buffering:
> >         http://unicorn.bogomips.org/Unicorn/TeeInput.html
> 
> 
> This is the approach I would take. I'm not sure if TeeInput supports it,
> but for a generic server supporting websocket type use cases, I'd add a
> discardable buffer API too, so you can "hijack" the input stream and
> release any stale resources.

I'm not completely sure what you mean[1], but both yahns and unicorn
support rack.hijack.  TeeInput cannot read beyond the current HTTP
request boundary, so I'm not sure there's anything that needs to change
in the HTTP servers.

If a client pipelines non-HTTP data after a normal HTTP request, that
would be a problem; but pipelining during a protocol change/negotiation
seems wrong to begin with.


[1] I've not tried rack.hijack with websockets, yet
    I just (hopefully) implemented it according to the Rack spec.
    GUI-oriented websocket things just do not interest me.

-- 

--- 
You received this message because you are subscribed to the Google Groups "Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2014-07-17 23:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 21:12 rational for rewind() Torsten Robitzki
2014-05-23 10:46 ` Magnus Holm
2014-05-24 12:35   ` Torsten Robitzki
2014-06-30 22:16     ` Daniel Doubrovkine
2014-07-15  4:30       ` James Tucker
2014-07-17 22:34 ` Eric Wong
2014-07-17 23:10   ` James Tucker
2014-07-17 23:44     ` Eric Wong [this message]
2014-07-18  0:00       ` James Tucker
2014-07-18  0:43         ` Eric Wong
2014-07-19  9:55     ` Torsten Robitzki

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-list from there: mbox

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

  List information: https://groups.google.com/group/rack-devel

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

  git send-email \
    --in-reply-to=20140717234405.GA24893@dcvr.yhbt.net \
    --to=rack-devel@googlegroups.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).