Skip to main content

run_with_streaming_response

Function run_with_streaming_response 

Source
pub async fn run_with_streaming_response<'a, S, B, E>(
    handler: S,
) -> Result<(), Error>
where S: Service<Request, Response = Response<B>, Error = E>, S::Future: Send + 'a, E: Debug + Into<Diagnostic>, B: Body + Unpin + Send + 'static, B::Data: Into<Bytes> + Send, B::Error: Into<Error> + Send + Debug,
Expand description

Runs the Lambda runtime with a handler that returns streaming HTTP responses.

See the AWS docs for response streaming.

§Managed concurrency

If AWS_LAMBDA_MAX_CONCURRENCY is set, this function returns an error because it does not enable concurrent polling. Use run_with_streaming_response_concurrent (requires the concurrency-tokio feature) instead.

§Panics

This function panics if required Lambda environment variables are missing (AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_FUNCTION_MEMORY_SIZE, AWS_LAMBDA_FUNCTION_VERSION, AWS_LAMBDA_RUNTIME_API).