Should incomingUni/BidirectionalStreams be "owning"?
jan-ivar opened this issue · comments
From #424 (comment) and #424 (comment):
Attempting to transfer
wt.incomingUndirectionalStreams
doesn't appear to work, as you say. WhengetReader()
is called on the transferred readable stream of streams, the error isA ReadableStream could not be cloned because it was not transferred.
Sorry about this. Currently when a stream is transferred, the chunks that are passed through the stream are always cloned, never transferred. Since
incomingUnidirectionalStreams
is a stream of streams, each chunk is a stream, and streams can only be transferred, not cloned.There was a plan to also support transferring the chunks (see Future Work) but without a concrete use case it never proceeded to the design stage.
whatwg/streams#1271 adds a new "owning"
ReadableStream type, which allows for transferable chunks, albeit for a different purpose.
@ricea would making incomingUnidirectionalStreams and incomingBidirectionalStreams "owning"
solve the DataCloneError
, or is that a different part of the spec?
Currently the "owning"
logic isn't wired up to the transferable streams logic. Once that is done, then it should work.
@ricea Do we have an issue open for that? Would it be different from whatwg/streams#1124?