- From: youennf <notifications@github.com>
- Date: Thu, 02 Dec 2021 04:09:04 -0800
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/pull/1193/review/821415455@github.com>
@youennf commented on this pull request. > +## Principles + +The envisioned changes to the streams specification could look like the following: +* Add a new 'transfer' type to `ReadableStream`, `WritableStream` and `TransformStream`. + For streams that do not have the 'transfer' type, nothing changes. +* Streams of the 'transfer' type can only manipulate Transferable or Serializable objects. + If a non Transferable or Serializable object is enqueued or written, the object is ignored as if it was never enqueued/written. +* If a Transferable object is enqueueud/written in a 'transfer' type `ReadableStreamDefaultController`, `TransformStreamDefaultController` + or `WritableStreamDefaultWriter`, create a copy of the object using StructuredSerializeWithTransfer/StructuredDeserializeWithTransfer. + Proceed with the regular stream algorithm by using the copy of the object instead of the object itself. +* If a Serializable object is enqueueud/written in a 'transfer' type `ReadableStreamDefaultController`, `TransformStreamDefaultController` + or `WritableStreamDefaultWriter`, create a copy of the object using StructuredSerialize/StructuredDeserialize. + Proceed with the regular stream algorithm by using the copy of the object instead of the object itself. +* Introduce a WhatWG streams 'close-able' concept. An object that is 'close-able' defines closing steps. + For instance `VideoFrame` closing steps could be defined using https://www.w3.org/TR/webcodecs/#close-videoframe. + `ArrayBuffer` closing steps could be defined using https://tc39.es/ecma262/#sec-detacharraybuffer. Good point, not sure that it fits the explainer but would definitely be good for a PR. -- 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/pull/1193#discussion_r761031847
Received on Thursday, 2 December 2021 12:09:16 UTC