- From: Domenic Denicola <notifications@github.com>
- Date: Wed, 11 Mar 2015 08:47:30 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Message-ID: <whatwg/streams/issues/294@github.com>
Per the lengthy discussions in #253 the new shape of ReadableByteStream will be something like: - `getReader()` returns a reader that, much like the "normal" ReadableStream, has automatically flowing auto-allocated chunks. So, `rbs.getReader().read()` will take no arguments and will auto-allocate a new `Uint8Array` each call. - Some other function, with straw-person name `getBYOBReader()`, returns a reader that requires you to feed it buffers. So, you call `rbs.getBYOBReader().read(myBuffer)` and it reads into `myBuffer`. (After doing appropriate detaching/transferring to ensure no observable data races, etc., as discussed extensively in #253 and elsewhere.) Here "BYOB" stands for "bring your own buffer," by the way. Ideas for names: - `getBYOBReader()` - `getManualReader()` - `getBufferedReader()` - `getFedReader()` - `getManualFeedReader()` - `getControlledAllocationReader()` - `getReadIntoReader()` - `getPullingReader()` (referring to how generally no reading is done until you call `read(view)`, i.e. data is "pulled") - `getReader({ feedBuffers: true })` or similar (introduces some kinda-strange return type variance though) Are there any precedents from other platforms we can draw on, just for vocabulary if nothing else? --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/294
Received on Wednesday, 11 March 2015 15:47:56 UTC