Skip to content

Commit b8ea13c

Browse files
committed
Readme: Making Request and Response types explicit in Lambda.run callback
1 parent 71587ea commit b8ea13c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Next, create a `main.swift` and implement your Lambda.
5959
import AWSLambdaRuntime
6060

6161
// in this example we are receiving and responding with strings
62-
Lambda.run { (context, payload: String, callback) in
62+
Lambda.run { (context, payload: String, callback: @escaping (Result<String, Error>) -> (Void)) in
6363
callback(.success("Hello, \(payload)"))
6464
}
6565
```
@@ -81,7 +81,7 @@ Next, create a `main.swift` and implement your Lambda.
8181
}
8282

8383
// In this example we are receiving and responding with `Codable`.
84-
Lambda.run { (context, request: Request, callback) in
84+
Lambda.run { (context, request: Request, callback: @escaping (Result<Response, Error>) -> (Void)) in
8585
callback(.success(Response(message: "Hello, \(request.name)")))
8686
}
8787
```
@@ -94,7 +94,7 @@ Next, create a `main.swift` and implement your Lambda.
9494
import AWSLambdaEvents
9595

9696
// In this example we are receiving an SQS Message, with no response (Void).
97-
Lambda.run { (context, message: SQS.Message, callback) in
97+
Lambda.run { (context, message: SQS.Message, callback: @escaping (Result<Void, Error>) -> (Void)) in
9898
...
9999
callback(.success(Void()))
100100
}

0 commit comments

Comments
 (0)