Skip to content

README.MD example about SimpleLambdaHandler #285

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

Closed
fitomad opened this issue Feb 8, 2023 · 3 comments
Closed

README.MD example about SimpleLambdaHandler #285

fitomad opened this issue Feb 8, 2023 · 3 comments

Comments

@fitomad
Copy link
Contributor

fitomad commented Feb 8, 2023

The README.MD file contains an example about the use of SimpleLambdaHandler receiving an Amazon SQS event

import AWSLambdaRuntime
import AWSLambdaEvents

@main
struct MyLambda: SimpleLambdaHandler {
    // In this example we are receiving a SQS Event, with no response (Void).
    func handle(_ event: SQS.Event, context: LambdaContext) async throws -> Void {
        ...
    }
}

There's no SQS.Event type available in the AWSLambdaEvents package, It seems that the expected type is SQSEvent

import AWSLambdaRuntime
import AWSLambdaEvents

@main
struct MyLambda: SimpleLambdaHandler {
    // In this example we are receiving a SQS Event, with no response (Void).
    func handle(_ event: SQSEvent, context: LambdaContext) async throws {
        ...
    }
}

Also removed the returning Void following the Apple style guide, but I understand that is presented due to educational purpose.

@tomerd
Copy link
Contributor

tomerd commented Feb 9, 2023

thanks @fitomad would you like to submit a PR to address this?

@fitomad
Copy link
Contributor Author

fitomad commented Feb 9, 2023

Created a PR with code #286 😜

@tomerd tomerd closed this as completed Feb 10, 2023
@tomerd
Copy link
Contributor

tomerd commented Feb 10, 2023

thanks @fitomad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants