From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.76.159.169 with SMTP id xd9csp147271oab; Mon, 14 Jul 2014 21:30:42 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncBD75LW742ECRB4G4SKPAKGQEEH3WAYQ@googlegroups.com designates 10.182.220.168 as permitted sender) client-ip=10.182.220.168 Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncBD75LW742ECRB4G4SKPAKGQEEH3WAYQ@googlegroups.com designates 10.182.220.168 as permitted sender) smtp.mail=rack-devel+bncBD75LW742ECRB4G4SKPAKGQEEH3WAYQ@googlegroups.com; dkim=pass header.i=@googlegroups.com X-Received: from mr.google.com ([10.182.220.168]) by 10.182.220.168 with SMTP id px8mr24892obc.32.1405398642283 (num_hops = 1); Mon, 14 Jul 2014 21:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe:content-type; bh=cZRSWkN2nH46Pbp1PoQkUqHUDv/D6cva7lUc6OUNHuo=; b=tooPNO6bva20lKGm4+MlveSupXKeaFr+JLF6jz50E1MYC6sZSH84+rUpiGnbh466Xg p/Qy723F2ozc24XJfLe+AL2VWbbUb8Ebl3oWQlPgts9u8rP2R/dzvIaSCzX+lfbHIw3r lWPgmV1U8f0CFmyyiu6ATyLQSj5IQOu5ZkxaQl181Ixz0dYCuarsD5P5G8DN6CYWhj4G LjWr1ZGok1CsfGxJ32UQXb4JzBkR9eD8u0jX+g3L9h8sBaI7xKafCLxRYSB2piyWNECK yggbQ14JLCy7DrNfCfhC/QhXAVnxxu17tlO2TYgKo2DSlHhOhG8pJL1RuyHfEmwl2E3E tckA== X-Received: by 10.182.220.168 with SMTP id px8mr2545obc.32.1405398642251; Mon, 14 Jul 2014 21:30:42 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.182.24.194 with SMTP id w2ls1185703obf.51.gmail; Mon, 14 Jul 2014 21:30:40 -0700 (PDT) X-Received: by 10.182.45.161 with SMTP id o1mr10074144obm.2.1405398640725; Mon, 14 Jul 2014 21:30:40 -0700 (PDT) Received: from mail-oa0-x232.google.com (mail-oa0-x232.google.com [2607:f8b0:4003:c02::232]) by gmr-mx.google.com with ESMTPS id d3si699738igx.2.2014.07.14.21.30.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Jul 2014 21:30:40 -0700 (PDT) Received-SPF: pass (google.com: domain of jftucker@gmail.com designates 2607:f8b0:4003:c02::232 as permitted sender) client-ip=2607:f8b0:4003:c02::232; Received: by mail-oa0-x232.google.com with SMTP id g18so5373943oah.9 for ; Mon, 14 Jul 2014 21:30:40 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.63.166 with SMTP id h6mr7225643oes.79.1405398640504; Mon, 14 Jul 2014 21:30:40 -0700 (PDT) Received: by 10.76.71.197 with HTTP; Mon, 14 Jul 2014 21:30:40 -0700 (PDT) In-Reply-To: References: Date: Mon, 14 Jul 2014 21:30:40 -0700 Message-ID: Subject: Re: rational for rewind() From: James Tucker To: rack-devel@googlegroups.com X-Original-Sender: jftucker@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jftucker@gmail.com designates 2607:f8b0:4003:c02::232 as permitted sender) smtp.mail=jftucker@gmail.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Content-Type: multipart/alternative; boundary=001a11c21eaebc353904fe33dedc --001a11c21eaebc353904fe33dedc Content-Type: text/plain; charset=UTF-8 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 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 > 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 - > artsy.net - github/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. --001a11c21eaebc353904fe33dedc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The use case is generally explained in previous mails, but= yes it's a problem for these kinds of servers.

My b= est recommendation to you is that you violate the recommendation and clearl= y document the rationale. We can't easily address this in the SPEC at t= his 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=C2=A0https://github.com/intridea/grap= e/blob/5c785324a071f7eb527683256ad34db70e965830/lib/grape/middleware/format= ter.rb#L55.=C2=A0

Basically, in Rails the input would get read, and left at th= e 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 <Tors= ten@robitzki.de> wrote:
Hi Magnus,
=C2=A0<= /div>
One word: Middleware.

sorry, I didn't found the old disc= ussions 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 im= plementation?=C2=A0

My first thought was something like an unrewindable_inp= ut() function, that provides an input stream that doesn't provide a rew= ind() 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 rewi= nd(), the input would just have to store the part of the input that have to= be processed twice.

Cheers,
Torsten=C2=A0

--

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



<= /div>--

<= span style=3D"font-size:8.0pt">dB. | Moscow - Geneva - Seattle - New York code.dblock.org=C2=A0-=C2= =A0@dblockdotorg= =C2=A0-=C2=A0artsy.net=C2=A0-=C2=A0= github/dblock

--

---
You received this message because you are subscribed to the Google Groups &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail 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 &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to rack-dev= el+unsubscribe@googlegroups.com.
For more options, visit http= s://groups.google.com/d/optout.
--001a11c21eaebc353904fe33dedc--