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

@annevk commented on this pull request.



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

#1177. I'll rebase this on top once that lands.

-- 
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#discussion_r579257331

Received on Friday, 19 February 2021 15:13:41 UTC