- From: Takeshi Yoshino <notifications@github.com>
- Date: Mon, 06 Apr 2015 01:22:17 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Message-ID: <whatwg/streams/issues/312/89973390@github.com>
It seems this can be achieved with a little work. E.g., in `ReadableStreamReader.prototype.read()` only the step 6 is specific to the queue-backed type ReadableStream implementation. If we extract this step as an abstract operation say `GenerateChunk()` that returns a tuple of `{ sync, value, done }`, then this algorithm would be: - ... - Let _result_ be GenerateChunk(**this**[[ownerReadableStream]]). - If _result_@[[sync]] is **true**, - If _result_@[[done]] is **true**, call-with-rethrow CloseReadableStream(**this**@[[ownerReadableStream]]). - Return a new promise resolved with CreateIterResultObject(_result_@[[chunk]], **false**). - Otherwise, ... Now, the algorithm is describing all the constraints on how `reader.read()` should behave and interaction with other parts of the interface without saying anything about internal buffering. POSIX `select`+`read` based ReadableStream may implement `GenerateChunk()` to generate an ArrayBufferView and read(2) and return it synchronously. --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/312#issuecomment-89973390
Received on Monday, 6 April 2015 08:22:46 UTC