Skip to content
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 #229

Merged
merged 6 commits into from
May 12, 2023
Merged

Support Lambda Streaming #229

merged 6 commits into from
May 12, 2023

Conversation

Skn0tt
Copy link
Contributor

@Skn0tt Skn0tt commented Apr 11, 2023

AWS launched support for HTTP Streaming in Lambda a couple of days ago: https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/

This PR adds support for this to lambda-local. It polyfills the two globals awslambda.streamifyResponse and awslambda.HttpResponseStream.from, and makes it so that execute returns a ReadableStream as body, if streaming is used.

I'll leave support for watch to a separate PR, so we can keep this one small.

@Skn0tt
Copy link
Contributor Author

Skn0tt commented May 10, 2023

@gpotter2 I see you reviewed my other PR, so i'm tagging you here. Do you think someone will get to review this within the next weeks? It'd be good to have this functionality for usage in the Netlify CLI, and if this takes a while to be reviewed then i'll publish & use my fork in the meantime.

@gpotter2
Copy link
Collaborator

@Skn0tt Thanks for the ping. The PR looks good, so I'll merge it and make a release ASAP.
Feel free to ping me directly when you need anything

@@ -0,0 +1,55 @@
import { PassThrough } from "stream";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: would you mind adding a docstring to this file explaining what it does and linking to https://aws.amazon.com/fr/blogs/compute/introducing-aws-lambda-response-streaming/ ? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Done in 4acb177.

@Skn0tt
Copy link
Contributor Author

Skn0tt commented May 11, 2023

Wow, thanks for the quick response! Addressed your nit.

@eduardoboucas
Copy link
Contributor

@gpotter2 I'd love to use this. If there's anything missing from this PR that I can help, please let me know. Thanks in advance! ❤️

@gpotter2 gpotter2 merged commit 618782e into ashiina:develop May 12, 2023
@eduardoboucas
Copy link
Contributor

@gpotter2 Thanks for merging! Would you be open to using an automated flow for publishing to npm, so you don't have to be pestered to trigger it manually? I'd be happy to help put that together.

@gpotter2
Copy link
Collaborator

Hi guys. Sorry for the giant delay.
I've released 2.1.0 that includes, among other things, this PR.

Wow, thanks for the quick response!

😢

Would you be open to using an automated flow for publishing to npm, so you don't have to be pestered to trigger it manually? I'd be happy to help put that together.

As much as I'd like to be able to answer "Nah, I prefer to do it manually.", this would probably reduce such delays. If it's not too much work this would be appreciated.

Cheers and happy summer

@Skn0tt
Copy link
Contributor Author

Skn0tt commented Jul 20, 2023

If it's not too much work this would be appreciated.

Absolutely! Our team's plate is full right now, but I put it in our backlog and hope we'll get to open that PR in the coming days/weeks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants