[streams] Port locking infrastructure to writable streams (#319)

Writable streams need a similar way of being locked for exclusive writing, as readable streams do with their readers. This is notably crucial for off-main-thread piping (#97).

One problem that immediately presents itself, looking at the current list of writable stream properties and methods (closed/ready/state/abort()/close()/write()), is that pretty much all of them belong on the writer. Does that mean writable streams themselves become empty objects with getWriter() methods!?

I guess we could add a few pass-throughs (like ReadableStream.prototype.cancel acquiring, then releasing, a reader). Do we just add pass-through for everything? Well, probably not for ready/state/closed at least, as that causes problems. But if all we have is abort()/close()/write() passthroughs, doesn't that encourage the bad practice of ignoring backpressure signals? Maybe just abort() and write()?

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

Received on Tuesday, 7 April 2015 22:17:45 UTC