Closed GabrielBianconi closed 7 months ago
Lambda response streaming is decided by the invoke mode of function URLs. When you configure a function URL to response streaming, all the invokes are streamed. It is not possible to switch between buffered and streamed responses per invoke, unless you build a custom frontend to invoke the lambda function using Lambda API directly.
Makes sense, thank you.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one.
I'm trying to build a Lambda with routes for both streaming (Axum SSE) and regular (buffered) handlers.
I've tried using
run_with_streaming_response
, which works as expected for the streaming handlers but sends an empty response for regular handlers.With
run
, the regular handler works as expected but it also buffers the streaming handler before responding.Here's a minimal example:
Is there a way to set up a Lambda that accepts both types of handlers?
Thank you.