Re: [streams] Port precise flow control to writable streams (#318)

> I think desiredSize is the right thing to expose.

OK, this makes sense. I am still kind of unclear whether the producer or the stream should be setting the high water mark, but if we assume the stream, then this seems correct.

> waitForDesiredSize(n) is useful when the producer know that the stream will have a space >= n. Given a stream but without high water mark value, a producer cannot determine what n would work (don't wait forever) for the stream.

This seems like a potentially big problem. I think it would mean that unless the producer controls the high water mark, then waitForDesiredSize(n) is never very useful. Because you never know if you might end up waiting forever.

Maybe one fix is that if n > highWaterMark, we notify you anyway, when desiredSize = highWaterMark.

> I think we need to make n optional and then waitForDesiredSize(undefined) work as waitForDesiredSizeChange/Increase(). I.e. equiv of (3), (4). I think it would work like the following:

Hmm, what do you think of making it work like (1) or (2)?

Also, if we make these require positive, then for HWM = 0 writable streams they all reduce to the same thing. Probably that is OK.

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

Received on Tuesday, 25 August 2015 00:18:11 UTC