[streams] Introduce readable stream controller class (#310)

Instead of creating enqueue, close, and error functions per-stream, and passing (some subset of them) to the underlying source's start() and pull() methods, we instead create an instance of the ReadableStreamController class, which has methods enqueue(), close(), and error().

This closes #309, which contains more discussion and justification. It sets the stage for #301 (which will work by adding another property to the ReadableStreamController class).

Spec should be available for review at https://streams.spec.whatwg.org/branch-snapshots/rs-controller when the build completes.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Introduce readable stream controller class

-- File Changes --

    M index.bs (284)
    M reference-implementation/lib/readable-stream.js (232)
    M reference-implementation/lib/transform-stream.js (8)
    M reference-implementation/test/bad-underlying-sources.js (88)
    M reference-implementation/test/brand-checks.js (51)
    M reference-implementation/test/count-queuing-strategy.js (6)
    M reference-implementation/test/pipe-through.js (30)
    M reference-implementation/test/pipe-to-options.js (26)
    M reference-implementation/test/pipe-to.js (108)
    M reference-implementation/test/readable-stream-cancel.js (14)
    M reference-implementation/test/readable-stream-reader.js (56)
    M reference-implementation/test/readable-stream-templated.js (56)
    M reference-implementation/test/readable-stream.js (122)
    M reference-implementation/test/utils/duck-typed-pass-through-transform.js (6)
    M reference-implementation/test/utils/sequential-rs.js (6)

-- Patch Links --

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

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

Received on Tuesday, 31 March 2015 00:37:15 UTC