Skip to content

update and add examples to new APIs #228

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 3 commits into from
Sep 25, 2021

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Sep 23, 2021

motivation: keep code up to date with API changes

changes:

  • take advantage of @main where possible
  • move the top level Sample code to the examples subdirectory
  • extract a few examples form the "LambdaFunctions" directory (which is really a deployment demo) and move them to the top level Examples directory
  • rename "LambdaFunctions" examples as "Deployments" to make their intent clearer
  • add a sample that demonstrates how to test a lambda now that SwiftPM can test executables directly
  • update the test-sample docker setup to build & test th new samples
  • fix a few typos and In/Out typealias left overs
  • remove LinuxMain since its no longer required

@tomerd tomerd force-pushed the update-example-and-tests branch 5 times, most recently from 9ef3ddb to bb94234 Compare September 23, 2021 01:48
@fabianfett
Copy link
Member

What's the benefit of moving the String and Codable sample out of the main Package.swift?

@fabianfett fabianfett self-requested a review September 23, 2021 15:11
@tomerd
Copy link
Contributor Author

tomerd commented Sep 23, 2021

What's the benefit of moving the String and Codable sample out of the main Package.swift?

its much less noisy. these are really just samples and so they should not be part of the main package. One area where this causes headache is that tools that scan packages (like package collections and package indexes) and cannot tell that these modules are "not important" so they show up as valid modules you may want to use, which his not the intent

Copy link
Contributor

@stevapple stevapple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much neater!

@@ -19,7 +19,6 @@ import NIO
// use this example which is more performant.
// `EventLoopLambdaHandler` does not offload the Lambda processing to a separate thread
// while the closure-based handlers do.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the description here should also be modified?

motivation: keep code up to date with API changes

changes:
* take advantage of @main where possible
* move the top level Sample code to a new "Simple" examples subdirectory
* add a sample that demonstrates how to test a lambda now that SwiftPM can test executables directly
* update the test-sample docker setup to build & test th new samples
* fix a few typos and In/Out typealias left overs
@tomerd tomerd force-pushed the update-example-and-tests branch from bb94234 to e861641 Compare September 23, 2021 17:37
Copy link
Contributor

@stevapple stevapple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shall encourage AWSLambdaRuntimeCore with NIOCore with EventLoopLambdaHandler, and AWSLambdaRuntime with LambdaHandler?

@tomerd tomerd force-pushed the update-example-and-tests branch from e7c327f to bd39461 Compare September 24, 2021 04:44
@tomerd tomerd added the 🔨 semver/patch No public API change. label Sep 25, 2021
@tomerd tomerd mentioned this pull request Sep 25, 2021
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Much cleaner! Thanks!

@fabianfett fabianfett merged commit b757de0 into swift-server:main Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants