From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.76.133.195 with SMTP id pe3csp289723oab; Mon, 30 Jun 2014 15:16:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=dkim-signature:x-gm-message-state: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=N4Ow7r2fMUrwaLDFT8RiqZebzr5WVcycSQN2jh9C3bc=; b=ATBVN9KqebioLbHp9TNnhrJpVmDr89vXDbevmxGIGgqN9XCgyQHGUnzCpCJi4UyAUY pjnMPT2wKAi1l/jQ7nvxfmIH0+iVrOyBfwHb04uvchZHgbm8cUR4VQy6nlORlwuQRr1j CLWInKtZrY8f7MqVeoqpeMyimie7zlspsT3+9nccdbgNZ0KeuXSNNfigKZDXA3ANZ53m aOwC7BZLKITc0hu7IO9ugsGnjk7+jeRUeXORIW+lMkhhD3LdYUOrdgykNY1bm+46O8O6 F2shXGgG+rSPtyPsUk2ynayZOG5cfZrje3Ry9AiAUA+qsCZ2CmcxGa8My+yZeYc2IYIq VIeA== Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncBCBZDDWO4YPBBN6DY6OQKGQEBG2QZKA@googlegroups.com designates 10.140.84.38 as permitted sender) client-ip=10.140.84.38 Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncBCBZDDWO4YPBBN6DY6OQKGQEBG2QZKA@googlegroups.com designates 10.140.84.38 as permitted sender) smtp.mail=rack-devel+bncBCBZDDWO4YPBBN6DY6OQKGQEBG2QZKA@googlegroups.com; dkim=pass header.i=@googlegroups.com X-Received: from mr.google.com ([10.140.84.38]) by 10.140.84.38 with SMTP id k35mr561049qgd.30.1404166583848 (num_hops = 1); Mon, 30 Jun 2014 15:16:23 -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=N4Ow7r2fMUrwaLDFT8RiqZebzr5WVcycSQN2jh9C3bc=; b=gI7klts4ADeH6t8x7dJ4l7CKh5BoCvBE8z/5m6g18qt9K3TSyfptybqWx5xOsSKlNi paMgPiyj0uxB0PS6BZw54zcEAB0kRDptYXeMRNUHe0nmIVCqmHYfusiBINBsJGy0oT3h FNzsPENR4pLrl2ovjXPtZhok4Jg4duOmjTa//mGalbApBpf+d41n9WtpiAA6DvhY4H9T Hj1EVTIANCe4m8YQManPFuSW+rx3CbMWxU8FSqOQ+QpSmfQzpMlJxGRq/yjBheAGrqhj 1agDBF3RZxyZZZIxMPAu1T+YWgJAqzKyGPXOnphjp6inBItBKVGbDTJ1BCq0bQkv0QWO tw3Q== X-Received: by 10.140.84.38 with SMTP id k35mr47776qgd.30.1404166583705; Mon, 30 Jun 2014 15:16:23 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.140.94.163 with SMTP id g32ls374973qge.17.gmail; Mon, 30 Jun 2014 15:16:22 -0700 (PDT) X-Received: by 10.224.97.8 with SMTP id j8mr23168774qan.0.1404166582835; Mon, 30 Jun 2014 15:16:22 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by gmr-mx.google.com with ESMTPS id fn7si948321vdc.1.2014.06.30.15.16.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 15:16:22 -0700 (PDT) Received-SPF: none (google.com: dblock@dblock.org does not designate permitted sender hosts) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id il7so8200204vcb.13 for ; Mon, 30 Jun 2014 15:16:22 -0700 (PDT) X-Gm-Message-State: ALoCoQnTg/ovtGlxfcbfyYCH1TZju95Z33wE9OmzlpYpSclMMvQSTW/1BXNQtsu9acrOR8FRy2k1 MIME-Version: 1.0 X-Received: by 10.221.26.10 with SMTP id rk10mr40617098vcb.0.1404166582676; Mon, 30 Jun 2014 15:16:22 -0700 (PDT) Received: by 10.58.229.67 with HTTP; Mon, 30 Jun 2014 15:16:22 -0700 (PDT) X-Originating-IP: [108.41.177.192] In-Reply-To: References: Date: Mon, 30 Jun 2014 18:16:22 -0400 Message-ID: Subject: Re: rational for rewind() From: Daniel Doubrovkine To: rack-devel@googlegroups.com X-Original-Sender: dblock@dblock.org X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: dblock@dblock.org does not designate permitted sender hosts) smtp.mail=dblock@dblock.org 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: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: multipart/alternative; boundary=001a11339ae45dcaee04fd150286 --001a11339ae45dcaee04fd150286 Content-Type: text/plain; charset=UTF-8 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. --001a11339ae45dcaee04fd150286 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
If you're interested in an example that uses rewind, c= heck out=C2=A0https:= //github.com/intridea/grape/blob/5c785324a071f7eb527683256ad34db70e965830/l= ib/grape/middleware/formatter.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 <Torsten@robitzki.de><= /span> 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.



--
=

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-dev= el+unsubscribe@googlegroups.com.
For more options, visit http= s://groups.google.com/d/optout.
--001a11339ae45dcaee04fd150286--