From 22845fcf8efa657aba8dee71053ad2f3198322ee Mon Sep 17 00:00:00 2001 From: Fabian Fett Date: Thu, 4 Jun 2020 09:33:05 +0200 Subject: [PATCH] Readme: Making Request and Response types explicit in Lambda.run callback --- readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index dc4756b2..91d040ad 100644 --- a/readme.md +++ b/readme.md @@ -59,8 +59,8 @@ Next, create a `main.swift` and implement your Lambda. import AWSLambdaRuntime // in this example we are receiving and responding with strings - Lambda.run { (context, event: String, callback) in - callback(.success("Hello, \(event)")) + Lambda.run { (context, name: String, callback: @escaping (Result) -> Void) in + callback(.success("Hello, \(name)")) } ``` @@ -81,7 +81,7 @@ Next, create a `main.swift` and implement your Lambda. } // In this example we are receiving and responding with `Codable`. - Lambda.run { (context, request: Request, callback) in + Lambda.run { (context, request: Request, callback: @escaping (Result) -> Void) in callback(.success(Response(message: "Hello, \(request.name)"))) } ``` @@ -94,7 +94,7 @@ Next, create a `main.swift` and implement your Lambda. import AWSLambdaEvents // In this example we are receiving an SQS Message, with no response (Void). - Lambda.run { (context, message: SQS.Message, callback) in + Lambda.run { (context, message: SQS.Message, callback: @escaping (Result) -> Void) in ... callback(.success(Void())) }