Re: [whatwg/streams] A guide for a bidirectional transport? (#1032)

@vasilvv While you're correct that part of the answer also depends on the transport protocol, it just extends the question's scope. It basically boils down to just the two types of transports you've mentioned, so the same questions arises for transports that are capable of closing one half.

I'll complete my guesses for "one-half-closable" transports and, again, **please correct me if I'm wrong**:

What signals need to be propagated to the source/sink half when...

* the half closes normally: _Close the half's controller if not already closed. Error the half's controller._
* a half closes unexpectedly: _Error the source's controller. Error the sink's controller. There might be exceptions for specific transports where an unexpected close of one half should not close the other._
* a bidirectional transport errors: _Error the source's controller. Error the sink's controller. There might be exceptions for specific transports where errors can just be related to one half._

What signal needs to be propagated to the source half of the transport when...

* the source is being cancelled (and what do we need to wait for in that method): _Close the source half of the transport (and wait until it closed - resolve if it closed cleanly, otherwise reject)._

What signal needs to be propagated to the sink half when...

* the sink is being closed (and what do we need to wait for in that method): _Close the sink half of the transport (and wait until it is closed - resolve if it closed cleanly, otherwise reject)._
* the sink is being aborted (and what do we need to wait for in that method): _Close the sink half of the transport (and resolve immediately)._


-- 
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/1032#issuecomment-602558970

Received on Monday, 23 March 2020 12:24:47 UTC