Skip to content

Commit 7a5e7c2

Browse files
committed
Update doc
1 parent cdb33ab commit 7a5e7c2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ kotlin {
7272

7373
There are two types of lambda functions:
7474

75-
**Buffered** functions process incoming events by first collecting them
76-
into a buffer before execution. This is a default behavior.
75+
**Buffered** Lambda function collects all the data it needs to return as a response before sending it back. This is a default behavior of Lambda function. Response payload max size: 6 MB.
7776

7877
```kotlin
7978
class HelloWorldLambdaHandler : LambdaBufferedHandler<APIGatewayV2Request, APIGatewayV2Response> {
@@ -92,7 +91,7 @@ class HelloWorldLambdaHandler : LambdaBufferedHandler<APIGatewayV2Request, APIGa
9291
**Streaming** functions, on the other hand, process events in real-time as they arrive, without any
9392
intermediate buffering. This method is well-suited for use cases requiring immediate data
9493
processing, such as real-time analytics or event-driven architectures where low-latency responses
95-
are crucial.
94+
are crucial. [More details here.](https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html)
9695

9796
```kotlin
9897
class SampleStreamingHandler : LambdaStreamHandler<ByteArray, ByteWriteChannel> {
@@ -102,9 +101,13 @@ class SampleStreamingHandler : LambdaStreamHandler<ByteArray, ByteWriteChannel>
102101
}
103102
```
104103

105-
5. Specify application entry point using standard `main` and `LambdaRuntime.run` functions
104+
5. Specify application entry point using standard `main`. Call `LambdaRuntime.run` to execute Lambda by passing handler to it.
106105
```kotlin
107-
fun main() = LambdaRuntime.run { HelloWorldLambdaHandler() } // or SampleStreamingHandler for streaming lambda
106+
fun main() = LambdaRuntime.run { HelloWorldLambdaHandler() }
107+
108+
// or SampleStreamingHandler for streaming lambda
109+
fun main() = LambdaRuntime.run { SampleStreamingHandler() }
110+
108111
```
109112

110113
## Testing Runtime locally

0 commit comments

Comments
 (0)