Re: [whatwg/streams] Proposal: `ReadableStream.withSafeResolvers()` (Issue #1359)

ricea left a comment (whatwg/streams#1359)

> The referenced npm package seems to enqueue values regardless of backpressure, what's the motivation for that? I think the current way is more fail-safe where controller is given by pull callback which better handles backpressure (i.e. will be called only if more values are needed).

Good point. Sometimes ignoring backpressure is what you want, but providing an API which makes it easy to ignore backpressure would lead to people doing it by accident, which would be a backwards step.

I agree that's it's annoying that `enqueue()`, `close()` and `error()` throw exceptions on closed streams, but I wouldn't call them "unsafe". Signalling that they have not worked can be useful to prevent code from malfunctioning. If `enqueue()` didn't throw it would be easy to accidentally write code that kept trying to enqueue to a closed stream forever.

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

Message ID: <whatwg/streams/issues/1359/3815776681@github.com>

Received on Thursday, 29 January 2026 06:38:04 UTC