- From: Domenic Denicola <notifications@github.com>
- Date: Fri, 16 Feb 2018 19:39:02 +0000 (UTC)
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 16 February 2018 19:39:27 UTC
domenic commented on this pull request.
> + <pre><code class="lang-javascript">
+ async function writeSuppliedBytesForever(writableStream, getBytes) {
+ const writer = writableStream.getWriter();
+
+ while (true) {
+ await writer.ready;
+
+ const bytes = getBytes();
+ writer.write(bytes).catch(() => {});
+ }
+ }
+ </code></pre>
+
+ Unlike the previous example, where—because we were always writing exactly
+ {{WritableStreamDefaultWriter/desiredSize|writer.desiredSize}} bytes each time—the
+ {{WritableStreamDefaultWriter/write()}} and {{WritableStreamDefaultWriter/ready}} promises were synchronized, in this
I think the advice holds even in the absence of that assumption, so I'll leave it out.
--
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/streams/pull/875#discussion_r168851812
Received on Friday, 16 February 2018 19:39:27 UTC