Re: [streams] Readable byte streams should support an internal queue (#353)

> Right. I was trying to build an all-in-one class in that branch. Sorry for confusing. I was trying but seeing difficulties in designing the class without much complexity.

What is your general feeling? How much more complex is it, and would it be worth it? I am not sure anymore. Maybe the extra layer could be added future-compatibly?

> If controller.close() is called with a partially filled non-1byte-element-size TypedArray left in [[pendingViews]], the stream gets errored.

Hmm, why? Maybe I don't fully understand what "partially filled" means?

---

Doing some review of https://streams.spec.whatwg.org/branch-snapshots/bytestream/ (on the assumption we would want to go with this, even if that is not guaranteed pending more discussion above).

> stream@[[sourceSupportsByob]]

Maybe we should not allow ReadableByteStreams that don't support BYOB? It would help uncomplicate things, and would prevent the situation of giving a "false contract" where you support getByobReader() but actually it is just an inefficient shim over the normal reader.

> GetViewedArrayBuffer  / GetByteLength  / GetByteOffset 

Filed https://bugs.ecmascript.org/show_bug.cgi?id=4369 for you.

> this@[[filledBytesOfPendingViewsHead]] is not equal to 0, throw a RangeError exception.

Probably TypeError; there isn't a developer-supplied number that is out of range here.

> Reject readRequestPromise with CreateIterResultObject(stream@[[storedError]], chunk).

IMO it is OK to throw away the chunk if the stream has errored. It is better than rejecting with a non-Error. So I would just reject with stream@[[storedError]].

> PullFromReadableByteStreamInto 

This would be a bit clearer if 2.c was nested under 2.b IMO.

> RespondToReadableByteStreamByobReaderReadIntoRequest 

I think it needs to do transfers before giving back chunk

> If reader@[[readIntoRequests]] is empty, DetachReadableByteStreamReader(stream).

Why? Doesn't this lead to situations where you call .read(view) once and then all of a sudden your reader is no longer active? I am probably missing something.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/353#issuecomment-103275526

Received on Tuesday, 19 May 2015 00:08:08 UTC