Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

[node-fetch-server] Backpressure handling #76

@rossrobino

Description

@rossrobino

I ran into a backpressure issue when using node fetch server, I think it has to do with how the response body is being handled here: https://github.com/mjackson/remix-the-web/blob/main/packages/node-fetch-server/src/lib/request-listener.ts#L220

I looked into SvelteKit and srvx implementations, in both of these libraries they are checking if res.write is true, if not, they wait for the drain event to occur before proceeding again. This fixed the issue for me, when the stream's buffer is full it will wait for it to empty before continuing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions