Re: [whatwg/streams] pipeTo(): Rationale for not making shutdown() no-op when shuttingDown is set (#557)

I think I've been aware of what you've been trying to accomplish and its value correctly.

What I suggested can be summarized as "the shutdown sequence should happen only once triggered by the first error / close observation". There're 2 observation points (writable.closed, readable.closed) and two types of events (fulfillment and rejection) for each. These 4 events are observed separately by 4 different callbacks. Actions required to happen as reaction to them can happen in parallel. But, on the other hand, there's only one receiver of the completion which is the reject(), resolve() function for the pipePromise and depends on the result of the action taken. So, it's natural that we need some logic to do mutex-ing (bookkeeping) to run only one of the 4 callbacks.

Sorry, I didn't have time today for help writing tests. I'll do it tomorrow.

-- 
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/557#issuecomment-256303665

Received on Wednesday, 26 October 2016 10:04:31 UTC