Re: [whatwg/streams] Note about underlyingSink close() method is misleading (#617)

This is now implemented in my pull request #619 (feel free to clone that into a whatwg branch if it is easier). Sorry for the delay. I haven't written the standard changes yet, but that should be the easy part.

During implementation, I decided that one of the choices I made in my earlier comment https://github.com/whatwg/streams/issues/617#issuecomment-262890195 was not that great and changed it. Specifically:

* Calling `writer.abort()` during `us.close()` waits for the close to complete. It's natural to expect that once `abort()` returns, the stream is no longer active, which wouldn't be the case if `us.close()` was still in progress.
* When `us.close()` is in progress, the return from `writer.abort()` reflects the result of the close. If it succeeded then we didn't really abort, but the stream was cleaned up which is probably what the caller wanted.

In short, I made `abort()` succeed in more cases, because success is more useful than failure.

-- 
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/617#issuecomment-264172323

Received on Thursday, 1 December 2016 13:25:45 UTC