Re: [whatwg/streams] BYOB with "fill at least" semantics (#1175)

Technically `readAtLeast` could be more cleanly added as an optional dictionary to `ReadableStreamBYOBReader`'s `read`. I.e.
```
({done, value} = await read(buffer, {minBytes: 100});
```

One could easily imagine extending this with additional options like a timeout that ensures that we read minBytes bytes first OR the timeout hits returning whatever has been buffered so far. Without minBytes, then we read however much we can within that time interval. From a practical implementation standpoint that might be difficult to plumb through & there may not be a motivating use-case yet, but allowing an optional dictionary for customizing `minBytes` doesn't sound like a terrible idea.

-- 
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/issues/1175#issuecomment-942739932

Received on Wednesday, 13 October 2021 21:37:17 UTC