[streams] Garbage collection (#252)

It seems like most persisted stream APIs like WebSockets or WebRTC have some sort of defined garbage collection behavior.

http://www.w3.org/TR/2011/WD-websockets-20110929/#garbage-collection
http://w3c.github.io/webrtc-pc/#garbage-collection

Let’s say you create a `new WebSocket(‘ws://localhost)` and forgot about it, it *MAY* be GC’d. But once you ask for you stream you’ve created an observing reference even though its a pull source. And if you forget about the stream without canceling it, the stream wrappers maybe GC’d, but the WebSocket will still be active writing to a buffer no one can reach.

It kinda sucks JS itself can’t fully explain how WebSockets would actually implement this cleanup on GC behavior without JS object finalizers. Another place host objects get to cheat. More work for people trying to implement the extensible web manifesto ;)

*(Sorry if this has already been discussed somewhere)*

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/252

Received on Wednesday, 10 December 2014 21:55:52 UTC