-
Notifications
You must be signed in to change notification settings - Fork 167
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
Streaming response #289
Comments
I came here for the same question :) |
Hey, |
After reviewing Introducing AWS Lambda response streaming, I've just read:
... I think this means in order to support streaming, all responses would have to be "streamed" regardless if the response is a stream, something like: import serverlessHttp from 'serverless-http';
export const handler = awslambda.streamifyResponse(serverlessHttp(app, {
streaming: true,
})); And underneath, something like: async (event, responseStream, context) => {
responseStream.setContentType("application/json");
responseStream.write(JSON.stringify(res.body));
responseStream.end();
} Even if the final response isn't a stream? I imagine that might be problematic? Afterthought: It's a shame AWS didn't just iterate on their current {
statusCode: 200,
headers: { ... },
body: someReadStream,
isReadableStream: true
} |
I think not only this, but the Function URL itself is configured for streaming or not. I don't remember if the payload indicates this, otherwise, it has to be a configuration option. (but yes, supporting streaming here, is something I definitely want to support!) |
I am also needing to support streaming in my AWS Lambda. Preferably only one a specific endpoint. Has anyone already put together a workaround to get this to work until it is supported by this package? |
Hey, what is your opinion about streaming response? AWS announced support for streaming response for AWS Lambda with URL.
The idea is that the
handler
function is wrapped bystreamifyResponse
function (provided by AWS):More documentation from AWS:
https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/
Is adding response streams something you would consider to support?
The text was updated successfully, but these errors were encountered: