Skip to content

Commit 6da98dd

Browse files
committed
Update doc
1 parent 26bd180 commit 6da98dd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@ To create a simple lambda function, follow the following steps:
3535
2. Include library dependency into your module-level build.gradle file
3636
```
3737
kotlin {
38+
//..
3839
sourceSets {
3940
nativeMain.dependencies {
4041
implementation("io.github.trueangle:lambda-runtime:0.0.1")
4142
implementation("io.github.trueangle:lambda-events:0.0.1")
4243
}
4344
}
45+
//..
46+
}
4447
```
4548
3. Specify application entry point reference and supported targets
4649
```
@@ -61,10 +64,11 @@ kotlin {
6164
//..
6265
}
6366
```
64-
4. Choose lambda function type
67+
4. Choose lambda function type.
68+
6569
There are two types of lambda functions:
6670

67-
### Buffered
71+
** Buffered **
6872
Buffered functions process incoming events by first collecting them
6973
into a buffer before execution. This is a default behavior.
7074

@@ -82,7 +86,7 @@ class HelloWorldLambdaHandler : LambdaBufferedHandler<APIGatewayV2Request, APIGa
8286
}
8387
```
8488

85-
### Streaming
89+
** Streaming **
8690
Streaming functions, on the other hand, process events in real-time as they arrive, without any
8791
intermediate buffering. This method is well-suited for use cases requiring immediate data
8892
processing, such as real-time analytics or event-driven architectures where low-latency responses
@@ -96,6 +100,11 @@ class SampleStreamingHandler : LambdaStreamHandler<ByteArray, ByteWriteChannel>
96100
}
97101
```
98102

103+
5. Specify application entry point using standard `main` and `LambdaRuntime.run` functions
104+
```
105+
fun main() = LambdaRuntime.run { HelloWorldLambdaHandler() } // or SampleStreamingHandler for streaming lambda
106+
```
107+
99108
## Testing Runtime locally
100109

101110
To run local runtime

0 commit comments

Comments
 (0)