Re: [whatwg/streams] Add HasBackpressure operation to ReadableStream controllers (#767)

+1 on the general idea. There are a lot of changes here in the semantics, as the *ShouldCallPull abstract ops are much more in-depth, but in general it seems like the new semantics are better and more likely to cover edge cases.

Speaking of those edge cases, it might be worth writing some tests to cover them. E.g. do steps 1-5 of https://streams.spec.whatwg.org/#readable-stream-default-controller-should-call-pull ever cause us to return early? Can we trigger that from a test?

> Should this be an exported abstract operation rather than a polymorphic method? Does it matter?

Since it's polymorphic, that seems harder. I'm not sure what you mean by exported, but it seems unlikely, as this is somewhat of an implementation detail.

> Should this be a public operation? Alternatively, should ReadableStream*Controller have a "ready" promise which provides the functionality of TransformStreamReadableReadyPromise?

Heh, then the controllers really would look like writable streams...

I don't think it's necessary, because I can't see how an underlying source would use it. Maybe if we didn't have pull() {}, but only start() {}, then you could use that promise to implement pull() {}. But we have pull(), which takes care of this use case, I think.

-- 
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/767#issuecomment-324787427

Received on Thursday, 24 August 2017 23:49:40 UTC