hanabu / lambda-web

Run Rust web frameworks on AWS Lambda
MIT License
118 stars 38 forks source link

Support for streaming responses #20

Open clotodex opened 1 year ago

clotodex commented 1 year ago

AWS recently released support to stream responoses, see here

Since it accepts any kind of response (streamed or not) I think this should be implementable. I am using rocket so I only looked at that part of the code, but it seems like the major change would be to return a response instead of a value and adding all relevant headers etc to that response.

clotodex commented 1 year ago

Alright looking more into it it is definitely possible, since rocket::Response returns AsyncRead which can be accepted as stream into the hyper:::Response. But I met my match with lifetimes and async - I for the life of me cannot figure out how to make the AsyncRead live long enough for the lambda response.

sam-rusty commented 1 year ago

is there any update on this?

boymaas commented 7 months ago

also looking to support streaming responses, would be amazing if this works out of the box with axum