@@ -75,7 +75,8 @@ kotlin {
75
75
76
76
There are two types of lambda functions:
77
77
78
- ** Buffered** Lambda function collects all the data it needs to return as a response before sending
78
+ ###Buffered
79
+ Buffered Lambda function collects all the data it needs to return as a response before sending
79
80
it back. This is a default behavior of Lambda function. Response payload max size: 6 MB.
80
81
81
82
``` kotlin
@@ -95,7 +96,8 @@ class HelloWorldLambdaHandler : LambdaBufferedHandler<APIGatewayV2Request, APIGa
95
96
}
96
97
```
97
98
98
- ** Streaming** functions, on the other hand, sends back data as soon as it's available, rather than
99
+ ###Streaming
100
+ Streaming function, on the other hand, sends back data as soon as it's available, rather than
99
101
waiting for all the data to be ready. It processes and returns the response in chunks, piece by
100
102
piece, which can be useful when you want to start delivering results right away, especially for
101
103
large or ongoing tasks. This allows for faster responses and can handle data as it comes
@@ -122,7 +124,7 @@ class SampleStreamingHandler : LambdaStreamHandler<ByteArray, ByteWriteChannel>
122
124
fun main () = LambdaRuntime .run { HelloWorldLambdaHandler () }
123
125
```
124
126
125
- For SampleStreamingHandler
127
+ Or for SampleStreamingHandler
126
128
127
129
``` kotlin
128
130
fun main () = LambdaRuntime .run { SampleStreamingHandler () }
@@ -133,9 +135,9 @@ For more examples refer to project's sample.
133
135
134
136
## Testing Runtime locally
135
137
136
- To run local runtime
138
+ To run runtime
137
139
locally [ aws runtime emulator] ( https://github.com/aws/aws-lambda-runtime-interface-emulator ) is
138
- used:
140
+ used. Here's how to run project's sample :
139
141
140
142
1 . ` ./gradlew build ` to build lambda executable
141
143
2 . Modify runtime-emulator/Dockerfile to set proper path to the generated executable (.kexe) file,
@@ -144,7 +146,6 @@ used:
144
146
4 . Start server ` docker run -p 9000:8080 sample:latest `
145
147
5 . Execute function
146
148
via ` curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}' `
147
- 6 . ` docker ps; docker stop CONTAINER_ID ` to stop the execution
148
149
149
150
## Build and deploy to AWS
150
151
0 commit comments