Re: [whatwg/fetch] Formalize reading bodies (#1172)

@yutakahirano commented on this pull request.

Overall this looks good.

> @@ -1037,6 +1024,134 @@ worked on in <a href=https://github.com/whatwg/fetch/issues/1156>issue #1156</a>
  <var>body</var>.
 </ol>
 
+<hr>
+
+<p>To <dfn export for=body>incrementally read</dfn> a <a for=/>body</a> <var>body</var>, given an
+algorithm <var>processBodyChunk</var>, an algorithm <var>processEndOfBody</var>, an algorithm
+<var>processBodyError</var>, and an optional null, <a for=/>parallel queue</a>, or
+<a for=/>global object</a> <var>taskDestination</var> (default null), run these steps.
+<var>processBodyChunk</var> must be an algorithm accepting a <a for=/>byte sequence</a>.
+<var>processBodyError</var> must be an algorithm accepting an exception. <var>processEndOfBody</var>
+must be an algorithm accepting no arguments.
+
+<ol>
+ <li><p>Assert: <var>body</var>'s <a for=body>stream</a> is non-null.

This probablly out of scope but I think body's stream should be non-nullable, given we have a nullable body in Body.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1172#pullrequestreview-594203827

Received on Friday, 19 February 2021 14:08:16 UTC