Re: [whatwg/streams] Add support for ReadableStream "owning" type (PR #1271)

Random thought about being heavyweight, what about:

```js
let readable = new ReadableStream({
  start(controller) {
     // Wrap the chunk with a new interface (name chosen randomly)
     controller.enqueue(new Ownership(chunk));
  }
});
// ResetQueue checks whether the chunk is Ownership, and if yes,
// run dispose steps of the inner data of Ownership.
readable.cancel();
// Same for WritableStream, it would handle chunks that are Ownership.
readable.pipeTo(writable)
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1271#issuecomment-2113598097
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/pull/1271/c2113598097@github.com>

Received on Wednesday, 15 May 2024 22:39:53 UTC