-
Notifications
You must be signed in to change notification settings - Fork 113
Change Lambda.Context from class to struct #217
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
Change Lambda.Context from class to struct #217
Conversation
Can one of the admins verify this patch? |
6 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
@swift-server-bot test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jareyesda Thanks for looking into this. From my side everything looks great so far. Let's see what CI and @tomerd think.
Cool CI is green except for code-formatting. You will need to install |
This seems based on my previous work — I’m out today, can you give me a day tomorrow to double check this? Thanks |
Awesome. I'll go ahead and implement it. I'll follow up if I have any questions! |
Please do! I would love some feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okey, this seems good AFAICS.
Thanks for giving me a moment to have a look.
Still the formatting issue pending though it seems? |
Yes. Once I get home I will fix the formatting issue |
@swift-server-bot test this please |
Lambda.Context changed from a class to a struct.
Motivation:
As described in issue #215. Lambda.Context is currently a class that is a wrapper around values. Because it should be a value type, it was changed from a class to a struct.
Modifications:
The modifications are nearly identical to the changes from #167 - minus the addition of Baggage. The change from a class to a struct also follows CoW semantics to keep performance high. Line 104 of Sources/AWSLambdaRuntimeCore/LambdaRunner.swift had "convenience" and "file private" removed as well.
There are two differences between #167 and this modification: 1) At the time of forking, Tests/AWSLambdaRuntimeTests/Lambda+CodeableTest.swift was not present. 2) There is no Baggage
Result:
Lambda.Context is now a CoW-boxed struct instead of a class.
Note:
This is my first contribution. Please advise on how I can improve future contributions and the proper methodology on testing this change. Thank you all in advance :)