[streams] Implement flow-control in TransformStream fixes #330 maybe (#429)

Promise-ify the TransformStream so that it always waits for both a
write() and a pull() to have happened, returning a Promise in both
cases so that callers can know when it's safe to call again.

Previously pull() had no effect and the TransformStream was strictly
pumped by its write() callers.

NB: I may be making a dangerous assumption about pull() always being called.  I will endeavor to better come up-to-speed on the spec and reference implementation and investigate this on my own in the next ~1 week.  But in the meantime, I figured I'd put this here since it does pass the existing tests and the test I added that's only slightly pyramid-of-doomy.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/streams/pull/429

-- Commit Summary --

  * Implement flow-control in TransformStream fixes #330 maybe

-- File Changes --

    M reference-implementation/lib/transform-stream.js (62)
    M reference-implementation/test/transform-stream.js (49)

-- Patch Links --

https://github.com/whatwg/streams/pull/429.patch
https://github.com/whatwg/streams/pull/429.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/429

Received on Tuesday, 9 February 2016 07:09:22 UTC