-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support lambda streaming responses #2
Comments
Hey @GeoffreyBooth - thanks for reporting this! Yes, I will take a look at this when I get a chance (might be a couple of weeks). |
I've been looking into this a bit since I use this adapter and unfortunately Serverless Express doesn't currently support streaming (see CodeGenieApp/serverless-express#655). I also see that the response streaming logic present in the official adapter-node has been replaced with response buffering. |
Yeah, I am watching that serverless-express issue and hoping they can get someone to implement it soon, and I will update this adapter quickly afterward. I unfortunately do not have the time to do the work in serverless-express right now. I haven't used Middy in production before, so I am hesitant to rewrite this adapter to use it. |
Sorry for marketing myself but I had a library serverless-adapter that already supports Streaming Responses. But be aware the Streaming Responses has some quirks (aws/aws-lambda-nodejs-runtime-interface-client#94). Currently, I don't support Polka but I can add support for that framework in a few hours (it's very simple). |
@H4ad, I'm having a crack at implementing this using your library at bytesnz#1 (will put a PR in @tessellator once I've got it working). So far I've copied the updated handler from adapter-node and copied in the setup of serverless-adapter. |
Hi, thank you for creating this adapter! AWS lambda supports streamed responses now: https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html. This feature allows returning up to 20MB (up from the current limit of 6MB) and should provide a significant performance improvement for page load times as the page headers could be sent immediately while the body is rendered (possibly awaiting calls for data). Would you consider adding support for streaming to this adapter?
See also:
The text was updated successfully, but these errors were encountered: