Re: [streams] Operation stream (#287)

> This is an interesting one. I am still pretty sure this will not be good for the user-facing API. That is, I think the current user-facing API, both for stream creators and stream users, is pretty optimal. In particular the dual start() and pull() hooks for readable streams, and the write() and close() hooks for writable streams, are quite nice for stream creators.

I finally factored out underlying source and sink part but not like what we have in the spec now. The streams don't have a queue but just have code for managing promises and writer/reader.

- https://github.com/whatwg/streams/blob/aac7c91caa4fea6320c806c2c515e09e8e638af9/reference-implementation/lib/experimental/readable-operation-stream.js
- https://github.com/whatwg/streams/blob/aac7c91caa4fea6320c806c2c515e09e8e638af9/reference-implementation/lib/experimental/writable-operation-stream.js

> I think we should consider the API separately from the implementation, however. If it turns out that a two-sided stream implementation is conceptually simple and makes the spec and implementation easier to do, then that is good, as long as the API niceness is preserved. Conversely, if there are API improvements to be made, we can discuss them separately from discussing the strategy used to implement them.

Agreed. Now it's placed in https://github.com/whatwg/streams/blob/aac7c91caa4fea6320c806c2c515e09e8e638af9/reference-implementation/lib/experimental/operation-queue.js as just a helper.


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

Received on Saturday, 28 February 2015 00:06:28 UTC