A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/whatwg/streams/issues/297 below:

Getting errored/closed reader, Auto-releasing reader, Forcible cancel() on a stream · Issue #297 · whatwg/streams · GitHub

I read @domenic's pull request and would like to talk about getting / releasing reader. If you think the PR is the right place to discuss, feel free to close this issue.

getReader() should succeed on closed stream

Imagine we have a Response (in Fetch API) res.
res.body.getReader() should succeed even when the response has an empty body. That means res.body.getReader() should succeed when the body is closed. The result is a closed reader.

getReader() should succeed on errored stream

Mainly for being consistent with the closed case. We do not lose anything by allowing this. The result is an errored reader.

Do we need auto-release?

Currently a reader is automatically released when it is closed or errored. Do we need the functionality?
It was introduced at #251 (comment), but given that our API is simpler than before and the current API requires a user to be sane, I would like to revisit the problem.

Concern: What happens when canceled via stream? What happens when canceled via reader?

Do we need .closed in stream?

I don't think of a use case. If we drop it, Resource management of Response.body will be much simpler.

The usefulness may depend on whether if keep auto-release or not.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4