Skip to content
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

Update SDK to Swift 6 #2

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Update SDK to Swift 6 #2

wants to merge 9 commits into from

Conversation

Andrea-Scuderi
Copy link
Member

  • Use swift-service-lifecycle to manage BreezeLambdaAPI Service Lifecycle
  • Add a BreezeDemoApplication executable as example of usage
  • Use Structured Concurrency
  • Inject environment parameters to simplify test process
  • Use swift Testing

Note:
The PR cannot be merged until a stable version of swift-aws-lambda-runtime will be released

@Andrea-Scuderi Andrea-Scuderi self-assigned this Dec 24, 2024
@@ -0,0 +1,231 @@
{
Copy link
Member Author

@Andrea-Scuderi Andrea-Scuderi Dec 24, 2024

Choose a reason for hiding this comment

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

This file needs to be removed once the swift-aws-lambda-runtime gets a versioned

@@ -39,7 +39,7 @@ playground.xcworkspace
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
Package.resolved
# Package.resolved
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs to be reverted once the swift-aws-lambda-runtime gets a versioned


import PackageDescription

#if os(macOS)
let platforms: [PackageDescription.SupportedPlatform]? = [.macOS(.v15), .iOS(.v13)]
Copy link
Member Author

Choose a reason for hiding this comment

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

iOS is not supported, this need to be removed

.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/swift-serverless/swift-sls-adapter", from: "0.2.1"),
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.11.2"),
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", branch: "main"),
Copy link
Member Author

Choose a reason for hiding this comment

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

This needs to be updated once there is a version for the v2

var breezeApi: BreezeLambdaHandler<T>?

func handler(event: APIGatewayV2Request, context: LambdaContext) async throws -> APIGatewayV2Response {
guard let breezeApi else { throw BreezeLambdaAPIError.invalidHandler }
Copy link
Member Author

Choose a reason for hiding this comment

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

Can we avoid this?

try await Task.sleep(nanoseconds: 1_000_000_000)
gracefulShutdownTestTrigger.triggerGracefulShutdown()
}
group.cancelAll()
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why I need to cancel all the task here

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

Successfully merging this pull request may close these issues.

1 participant