Re: [whatwg/streams] Synchronous queue draining for WritableStream (#465)

Hmm. WritableStream.write() synchronously invokes underlyingSink.write(). With this optimization, sequential multiple write() calls are processed by:
- ws.write() -> sink.write()
- ws.write(), ws.write(), ... -> pending until the fulfillment callback is invoked
- sink.write() processes chunks enqueued by the 2nd and later ws.write() calls

Looks weird. But there's similar behavior in ReadableStream too? pull is invoked sync to read() and we can call rscontroller.enqueue() multiple times synchronously but they're delivered to the data consumer in async manner.

---
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/issues/465#issuecomment-222911453

Received on Wednesday, 1 June 2016 07:12:48 UTC