Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetch API to get ReadableStream #762

Closed
rakeshkota19 opened this issue Mar 1, 2020 · 5 comments
Closed

fetch API to get ReadableStream #762

rakeshkota19 opened this issue Mar 1, 2020 · 5 comments

Comments

@rakeshkota19
Copy link

I was trying to get reader of ReadableStream using getReader() and response.body of fetch. Even when i am not consuming data by calling read method, the buffer of stream is getting filled and it is even not applying any kind of backpressure and this is leading to huge memory usage. Is there any way to set WaterMark size on the ReadableStream returned by fetch. Is there any other way to control the buffer size of stream.

@rakeshkota19
Copy link
Author

Sorry i don't know if this is the right place to post. Please help me in resolving the issue.

@dgraham
Copy link
Contributor

dgraham commented Mar 13, 2020

This implementation of Fetch does not include readable stream support. Stack Overflow is the best place to ask usage questions.

@dgraham dgraham closed this as completed Mar 13, 2020
@pkieltyka
Copy link

how come there are no plans to include readable stream support to this polyfill? is it too heavy?

another idea @rakeshkota19 could be to add a polyfill on top of this polyfill :) I don't see why not.., like, whatwg-fetch-readablestream

@pkieltyka
Copy link

FYI, I've just tried https://www.npmjs.com/package/web-streams-polyfill in combination with whatwg-fetch and works well.

for quick reference,

<script src="https://unpkg.com/es6-promise"></script>
<script src="https://unpkg.com/whatwg-fetch"></script>
<script src="https://unpkg.com/web-streams-polyfill"></script>

then fetch() with resp.body.getReader() will work

@dgraham
Copy link
Contributor

dgraham commented Mar 23, 2020

how come there are no plans to include readable stream support to this polyfill?

#746 (comment)

Repository owner locked as resolved and limited conversation to collaborators Mar 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants