Skip to content

Readme: Making Request and Response types explicit in Lambda.run call… #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Error>) -> Void) in
callback(.success("Hello, \(name)"))
}
```

Expand All @@ -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<Response, Error>) -> Void) in
callback(.success(Response(message: "Hello, \(request.name)")))
}
```
Expand All @@ -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, Error>) -> Void) in
...
callback(.success(Void()))
}
Expand Down