You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `StreamingLambdaStatusAndHeadersResponse` structure allows you to specify:
38
35
-**statusCode**: HTTP status code (e.g., 200, 404, 500)
39
36
-**headers**: Dictionary of single-value HTTP headers (optional)
40
-
-**multiValueHeaders**: Dictionary of multi-value HTTP headers like Set-Cookie (optional)
41
37
42
38
### Streaming the Response Body
43
39
44
40
After setting headers, you can stream the response body by calling the `write(_:)` function of the `LambdaResponseStreamWriter` with partial data repeatedly before finally closing the response stream by calling `finish()`. Developers can also choose to return the entire output and not stream the response by calling `writeAndFinish(_:)`.
> The timeout value must be bigger than the time it takes for your function to stream its output. Otherwise, the Lambda control plane will terminate the execution environment before your code has a chance to finish writing the stream. Here, the sample function stream responses during 10 seconds and we set the timeout for 15 seconds.
97
+
> The timeout value must be bigger than the time it takes for your function to stream its output. Otherwise, the Lambda control plane will terminate the execution environment before your code has a chance to finish writing the stream. Here, the sample function stream responses during 3 seconds and we set the timeout for 5 seconds.
102
98
103
99
The `--architectures` flag is only required when you build the binary on an Apple Silicon machine (Apple M1 or more recent). It defaults to `x64`.
104
100
@@ -169,13 +165,7 @@ This should output the following result, with a one-second delay between each nu
0 commit comments