Skip to content

Add support for backpressure indication when using streams #734

@paustint

Description

@paustint

I have a use-case where from my server I am fetching paginated data from a remote server and turning it into a streaming XLSX file download to the user. I might have to fetch data 50+ times to get all the data, and have a queue to manage concurrency.

The problem comes when we are fetching data faster than the user is downloading the data, and we keep pushing more and more data on, which causes memory issues.

This is solved in streams by having an indicator of backpressure where the stream indicates if more data is allowed to be pushed.

Since I have implemented my CSV stream by hand, I can pause the stream and wait as needed, but with this library don't see where I can know if I should be allowed to push more data or not to the stream.

Would it be possible to return the backpressure boolean indicator when a row is committed?

Node Reference: https://nodejs.org/en/docs/guides/backpressuring-in-streams/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions