Skip to content

Commit f01a9b6

Browse files
authored
Use explicit NIO imports (#220)
- Use explicit NIO modules `NIOCore`, `NIOPosix` and `NIOEmbedded` introduced with SwiftNIO 2.32.0
1 parent 8525b63 commit f01a9b6

25 files changed

+39
-26
lines changed

Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ let package = Package(
2020
targets: [
2121
.target(name: "AWSLambdaRuntime", dependencies: [
2222
.byName(name: "AWSLambdaRuntimeCore"),
23-
.product(name: "NIO", package: "swift-nio"),
23+
.product(name: "NIOCore", package: "swift-nio"),
2424
.product(name: "NIOFoundationCompat", package: "swift-nio"),
2525
]),
2626
.target(name: "AWSLambdaRuntimeCore", dependencies: [
2727
.product(name: "Logging", package: "swift-log"),
2828
.product(name: "Backtrace", package: "swift-backtrace"),
2929
.product(name: "NIOHTTP1", package: "swift-nio"),
30-
.product(name: "NIO", package: "swift-nio"),
30+
.product(name: "NIOCore", package: "swift-nio"),
31+
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
32+
.product(name: "NIOPosix", package: "swift-nio"),
3133
.product(name: "_NIOConcurrency", package: "swift-nio"),
3234
]),
3335
.testTarget(name: "AWSLambdaRuntimeCoreTests", dependencies: [

Sources/AWSLambdaRuntime/Lambda+Codable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import struct Foundation.Data
1717
import class Foundation.JSONDecoder
1818
import class Foundation.JSONEncoder
19-
import NIO
19+
import NIOCore
2020
import NIOFoundationCompat
2121

2222
/// Extension to the `Lambda` companion to enable execution of Lambdas that take and return `Codable` events.

Sources/AWSLambdaRuntimeCore/HTTPClient.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
1615
import NIOConcurrencyHelpers
16+
import NIOCore
1717
import NIOHTTP1
18+
import NIOPosix
1819

1920
/// A barebone HTTP client to interact with AWS Runtime Engine which is an HTTP server.
2021
/// Note that Lambda Runtime API dictate that only one requests runs at a time.

Sources/AWSLambdaRuntimeCore/Lambda+LocalServer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
#if DEBUG
1616
import Dispatch
1717
import Logging
18-
import NIO
1918
import NIOConcurrencyHelpers
19+
import NIOCore
2020
import NIOHTTP1
21+
import NIOPosix
2122

2223
// This functionality is designed for local testing hence beind a #if DEBUG flag.
2324
// For example:

Sources/AWSLambdaRuntimeCore/Lambda+String.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14-
import NIO
14+
import NIOCore
1515

1616
/// Extension to the `Lambda` companion to enable execution of Lambdas that take and return `String` events.
1717
extension Lambda {

Sources/AWSLambdaRuntimeCore/Lambda.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import Darwin.C
2121
import _NIOConcurrency
2222
import Backtrace
2323
import Logging
24-
import NIO
24+
import NIOCore
25+
import NIOPosix
2526

2627
public enum Lambda {
2728
public typealias Handler = ByteBufferLambdaHandler

Sources/AWSLambdaRuntimeCore/LambdaConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import Dispatch
1616
import Logging
17-
import NIO
17+
import NIOCore
1818

1919
extension Lambda {
2020
internal struct Configuration: CustomStringConvertible {

Sources/AWSLambdaRuntimeCore/LambdaContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import Dispatch
1616
import Logging
17-
import NIO
17+
import NIOCore
1818

1919
// MARK: - InitializationContext
2020

Sources/AWSLambdaRuntimeCore/LambdaHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import _NIOConcurrency
1616
import Dispatch
17-
import NIO
17+
import NIOCore
1818

1919
// MARK: - LambdaHandler
2020

Sources/AWSLambdaRuntimeCore/LambdaLifecycle.swift

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

1515
import Logging
16-
import NIO
1716
import NIOConcurrencyHelpers
17+
import NIOCore
1818

1919
extension Lambda {
2020
/// `Lifecycle` manages the Lambda process lifecycle.

0 commit comments

Comments
 (0)