nodejs / nodejs.org

The Node.js® Website
https://nodejs.org
MIT License
6.16k stars 6.23k forks source link

Backpressuring in streams - vague example #6453

Open nenikola opened 7 months ago

nenikola commented 7 months ago

Enter your suggestions in details:

In section explaining Rules specific to readable streams, author states that first example is bad because it doesn't consider return value of a .push. However neither in the next example, nor the one after they show or explain how to properly handle .push. The last example:

image

is trivial as well as it's explanation, and is great miss of even greater opportunity to demonstrate a proper way of doing things for such an important topic.

I hope someone can fix it, I was just researching the matter and it causes a great confusion being written as it is.

bmuenzenmeyer commented 7 months ago

Would you be able to contribute the fix??

nenikola commented 7 months ago

@bmuenzenmeyer I can try but it may be wrong since I just started reading on the topic and figuring it out. I'll propose something tomorrow and hopefully it will be correct.