nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

Backpressuring in streams - vague example

Open nenikola opened this issue 1 year ago • 2 comments

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.

nenikola avatar Mar 05 '24 22:03 nenikola

Would you be able to contribute the fix??

bmuenzenmeyer avatar Mar 05 '24 23:03 bmuenzenmeyer

@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.

nenikola avatar Mar 06 '24 00:03 nenikola

If this issue is still open for all, I would like to work on this. @bmuenzenmeyer @AugustinMauroy @nenikola

shashankxrm avatar May 14 '25 10:05 shashankxrm

Thanks for your interest. We don't assign tickets if we can help it. Feel free to submit a pull request if you have time. Reference 🍪 https://www.redhat.com/en/blog/dont-lick-cookie

bmuenzenmeyer avatar May 14 '25 12:05 bmuenzenmeyer

To my knowledge best case is that you simply return when this.push(data) is false because you have filled the internal buffer

0hmX avatar Jun 09 '25 04:06 0hmX