rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: James Tucker <jftucker@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: rational for rewind()
Date: Mon, 14 Jul 2014 21:30:40 -0700	[thread overview]
Message-ID: <CABGa_T8LsAmuhRnF919ikb4+-X12jvTBsvPt4USmFVAZ2xfrtw@mail.gmail.com> (raw)
In-Reply-To: <CALCE7pngHXatzSvi0my+On41NLPrKRg0nCh8fn82KQ49ehb0mw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2727 bytes --]

The use case is generally explained in previous mails, but yes it's a
problem for these kinds of servers.

My best recommendation to you is that you violate the recommendation and
clearly document the rationale. We can't easily address this in the SPEC at
this time.


On Mon, Jun 30, 2014 at 3:16 PM, Daniel Doubrovkine <dblock@dblock.org>
wrote:

> If you're interested in an example that uses rewind, check out
> https://github.com/intridea/grape/blob/5c785324a071f7eb527683256ad34db70e965830/lib/grape/middleware/formatter.rb#L55
> .
>
> Basically, in Rails the input would get read, and left at the end of the
> stream. So when Grape was mounted on Rails it would want to re-read that
> input to get more/better/different data and therefore you had to call
> rewind.
>
>
> On Sat, May 24, 2014 at 8:35 AM, Torsten Robitzki <Torsten@robitzki.de>
> wrote:
>
>> Hi Magnus,
>>
>>
>>> One word: Middleware.
>>>
>>
>> sorry, I didn't found the old discussions here regarding rewind (maybe a
>> typo in my search phrase). Is there any proposal planned to change the
>> specs to allow a more effective input implementation?
>>
>> My first thought was something like an unrewindable_input() function,
>> that provides an input stream that doesn't provide a rewind() interface,
>> but buffers the data read through this interface, so that the original
>> input can still provide this data. If all middleware would be aware of this
>> interface and the final application wouldn't need to rewind(), the input
>> would just have to store the part of the input that have to be processed
>> twice.
>>
>> Cheers,
>> Torsten
>>
>> --
>>
>> ---
>> 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.
>>
>
>
>
> --
>
> dB. | Moscow - Geneva - Seattle - New York
> code.dblock.org - @dblockdotorg <http://twitter.com/#!/dblockdotorg> -
> artsy.net - github/dblock <https://github.com/dblock>
>
> --
>
> ---
> 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.
>

-- 

--- 
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.

[-- Attachment #2: Type: text/html, Size: 4961 bytes --]

  reply	other threads:[~2014-07-15  4:30 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 [this message]
2014-07-17 22:34 ` Eric Wong
2014-07-17 23:10   ` James Tucker
2014-07-17 23:44     ` Eric Wong
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=CABGa_T8LsAmuhRnF919ikb4+-X12jvTBsvPt4USmFVAZ2xfrtw@mail.gmail.com \
    --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).