Re: [whatwg/streams] Add Explainer for Byte Streams (#1081)

@domenic approved this pull request.

LGTM with nits!

> +
+    async pull(controller) {
+      // Even when the consumer is using the default reader, the auto-allocation
+      // feature allocates a buffer and passes it to us via byobRequest.
+      const v = controller.byobRequest.view;
+      v = crypto.getRandomValues(v);
+      controller.byobRequest.respond(v.byteLength);
+    },
+
+    autoAllocateChunkSize: DEFAULT_CHUNK_SIZE
+  });
+}
+```
+
+
+With this in hand, we can create and use BYOB readers for the returned ReadableStream. The adaptation between the

```suggestion
With this in hand, we can create and use BYOB readers for the returned `ReadableStream`. The adaptation between the
```

> +    async pull(controller) {
+      // Even when the consumer is using the default reader, the auto-allocation
+      // feature allocates a buffer and passes it to us via byobRequest.
+      const v = controller.byobRequest.view;
+      v = crypto.getRandomValues(v);
+      controller.byobRequest.respond(v.byteLength);
+    },
+
+    autoAllocateChunkSize: DEFAULT_CHUNK_SIZE
+  });
+}
+```
+
+
+With this in hand, we can create and use BYOB readers for the returned ReadableStream. The adaptation between the
+low-level byte tracking of the underlying byte source shown here, is all taken care of automatically by the streams

This sentence doesn't seem to be entirely complete? Adaptation between what and what?

-- 
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/1081#pullrequestreview-518997645

Received on Wednesday, 28 October 2020 19:07:20 UTC