Re: [fetch] Introduce Response.body. (#118) (#128)

> +<code title=concept-ReadableStream>ReadableStream</code> with given a byte stream
> +<var>bstream</var>, run these steps:
> +
> +<ol>
> + <li><p>Let <var>strategy</var> be an object. The user agent may choose any object.
> +
> + <li>
> +  <p>Let <var>pull</var> be an action that runs these substeps:
> +
> +  <ol>
> +    <li><p>Let <var>bytes</var> be a byte sequence which is 
> +    <span data-anolis-spec=encoding title=concept-stream-read>read</span> from <var>bstream</var>.
> +
> +    <li><p>If <span data-anolis-spec=encoding title=concept-stream-read>read</span> returns
> +    <span data-anolis-spec=encoding>end-of-stream</span>,
> +    <span title=concept-close-ReadableStream>close</span> <var>stream</var> defined below.

In fact, byte stream lacks some signals required by ReadableStream such as "process response body" and "process response end-of-file". I'm afraid we cannot specify this operation perfectly. Is it possible to state something like

To __construct__ a ReadableStream object from a byte stream _byteStream_, return a ReadableStream object so that consuming the ReadableStream object will result in chunks each of which is a Uint8Array object wrapping an ArrayBuffer and concatenate them all will result in a byte sequence that is equivalent to the byte sequence which would be read from _byteStream_.

?

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/128/files#r41132221

Received on Monday, 5 October 2015 11:08:43 UTC