-
Notifications
You must be signed in to change notification settings - Fork 45
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
Stream chunked data out of guest modules instead of buffering #115
Comments
/cc @fibonacci1729 |
Do you envisage asyncifying the call into the module, so that we can be returning the first bytes of the response as soon as the Wasm code produces them? Or are you just thinking of trying to reduce the copies between the stdout pipe, the buffer and the response body object? |
Why did I think we would need to asyncify the call into the module? Well, we can't map stdout into a pipe that feeds directly into the response stream, because we need to do some processing on the beginning of the stream to convert top matter to headers. But I wonder if we could do that with some clever pipe/stream infrastructure so that it happens automatically as data is written to/read from the pipe. #ThingsThatSoundEasierThanTheyInevitablyTurnOutToBe |
bytecodealliance/wit-bindgen#82 and streams should help with this. |
Right now we buffer the entire HTTP payload before sending to the client. That is really bad performance for things like images. We should instead be able to send chunked data to the client.
The text was updated successfully, but these errors were encountered: