Skip to content

Commit 3e8c07d

Browse files
committed
Adopt Concurrency adoption guidelines
1 parent 011e8dd commit 3e8c07d

File tree

6 files changed

+7
-11
lines changed

6 files changed

+7
-11
lines changed

Sources/AWSLambdaRuntimeCore/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public enum Lambda {
5353
return String(cString: value)
5454
}
5555

56-
#if swift(>=5.5)
56+
#if compiler(>=5.5) && canImport(_Concurrency)
5757
// for testing and internal use
5858
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
5959
internal static func run<Handler: LambdaHandler>(configuration: Configuration = .init(), handlerType: Handler.Type) -> Result<Int, Error> {

Sources/AWSLambdaRuntimeCore/LambdaHandler.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import NIOCore
1717

1818
// MARK: - LambdaHandler
1919

20-
#if compiler(>=5.5)
20+
#if compiler(>=5.5) && canImport(_Concurrency)
2121
/// Strongly typed, processing protocol for a Lambda that takes a user defined `Event` and returns a user defined `Output` async.
2222
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
2323
public protocol LambdaHandler: EventLoopLambdaHandler {
@@ -51,7 +51,6 @@ extension LambdaHandler {
5151
}
5252
}
5353

54-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
5554
extension LambdaHandler {
5655
public static func main() {
5756
_ = Lambda.run(handlerType: Self.self)

Sources/AWSLambdaTesting/Lambda+Testing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// XCTAssertEqual(result, "echo" + input)
3434
// }
3535

36-
#if swift(>=5.5)
36+
#if compiler(>=5.5) && canImport(_Concurrency)
3737
import AWSLambdaRuntime
3838
import AWSLambdaRuntimeCore
3939
import Dispatch

Tests/AWSLambdaRuntimeCoreTests/LambdaHandlerTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import NIOCore
1717
import XCTest
1818

1919
class LambdaHandlerTest: XCTestCase {
20-
#if compiler(>=5.5)
20+
#if compiler(>=5.5) && canImport(_Concurrency)
2121

2222
// MARK: - LambdaHandler
2323

Tests/AWSLambdaRuntimeTests/Lambda+CodeableTest.swift renamed to Tests/AWSLambdaRuntimeTests/Lambda+CodableTest.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ class CodableLambdaTest: XCTestCase {
8282
XCTAssertEqual(response?.requestId, request.requestId)
8383
}
8484

85-
#if swift(>=5.5)
86-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
85+
#if compiler(>=5.5) && canImport(_Concurrency)
8786
func testCodableVoidHandler() {
8887
struct Handler: LambdaHandler {
8988
typealias Event = Request
@@ -112,7 +111,6 @@ class CodableLambdaTest: XCTestCase {
112111
}
113112
}
114113

115-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
116114
func testCodableHandler() {
117115
struct Handler: LambdaHandler {
118116
typealias Event = Request
@@ -183,11 +181,10 @@ private struct Response: Codable, Equatable {
183181
}
184182
}
185183

186-
#if swift(>=5.5)
184+
#if compiler(>=5.5) && canImport(_Concurrency)
187185
// NOTE: workaround until we have async test support on linux
188186
// https://github.com/apple/swift-corelibs-xctest/pull/326
189187
extension XCTestCase {
190-
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
191188
func XCTAsyncTest(
192189
expectationDescription: String = "Async operation",
193190
timeout: TimeInterval = 3,

Tests/AWSLambdaTestingTests/Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
#if swift(>=5.5)
15+
#if compiler(>=5.5) && canImport(_Concurrency)
1616
import AWSLambdaRuntime
1717
import AWSLambdaTesting
1818
import NIOCore

0 commit comments

Comments
 (0)