Skip to content

Commit c4c71cc

Browse files
committed
initial commit
1 parent 2669009 commit c4c71cc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Package.swift

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ let package = Package(
1919
dependencies: [
2020
.package(url: "https://github.com/apple/swift-nio.git", from: "2.76.0"),
2121
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
22+
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.6.3"),
2223
],
2324
targets: [
2425
.target(
@@ -36,6 +37,7 @@ let package = Package(
3637
.product(name: "NIOCore", package: "swift-nio"),
3738
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
3839
.product(name: "NIOPosix", package: "swift-nio"),
40+
.product(name: "ServiceLifecycle", package: "swift-service-lifecycle"),
3941
],
4042
swiftSettings: [.swiftLanguageMode(.v5)]
4143
),

Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import Logging
1616
import NIOConcurrencyHelpers
1717
import NIOCore
18+
import ServiceLifecycle
1819

1920
#if canImport(FoundationEssentials)
2021
import FoundationEssentials
@@ -25,7 +26,7 @@ import Foundation
2526
// We need `@unchecked` Sendable here, as `NIOLockedValueBox` does not understand `sending` today.
2627
// We don't want to use `NIOLockedValueBox` here anyway. We would love to use Mutex here, but this
2728
// sadly crashes the compiler today.
28-
public final class LambdaRuntime<Handler>: @unchecked Sendable where Handler: StreamingLambdaHandler {
29+
public final class LambdaRuntime<Handler>: Service, @unchecked Sendable where Handler: StreamingLambdaHandler {
2930
// TODO: We want to change this to Mutex as soon as this doesn't crash the Swift compiler on Linux anymore
3031
let handlerMutex: NIOLockedValueBox<Handler?>
3132
let logger: Logger

0 commit comments

Comments
 (0)