Skip to content

Commit e50b64f

Browse files
authored
Use more specific NIO imports (#1239) (#1241)
Motivation: The `NIO` module is now a 'shell' module which re-exports `NIOCore`, `NIOPosix` and `NIOEmbeeded`. Modifications: For the GRPC and GRPCTests modules: - Replace "import NIO" with "import NIOCore" - Add imports for NIOEmbeeded and NIOPosix as necessary Result: Imports are closer to what we actually use. (cherry picked from commit c88f038)
1 parent f541ca4 commit e50b64f

File tree

145 files changed

+207
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+207
-149
lines changed

Package.swift

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ let package = Package(
2626
dependencies: [
2727
// GRPC dependencies:
2828
// Main SwiftNIO package
29-
.package(url: "https://github.com/apple/swift-nio.git", from: "2.28.0"),
29+
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
3030
// HTTP2 via SwiftNIO
31-
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.17.0"),
31+
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.18.2"),
3232
// TLS via SwiftNIO
3333
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.14.0"),
3434
// Support for Network.framework where possible.
35-
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.6.0"),
35+
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.11.1"),
3636
// Extra NIO stuff; quiescing helpers.
3737
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.4.0"),
3838

@@ -46,8 +46,8 @@ let package = Package(
4646
// Logging API.
4747
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.0"),
4848

49-
// Argument parsering: only for internal targets (i.e. examples).
50-
// swift-argument-parser only provides source compatability guarantees between minor version.
49+
// Argument parsing: only for internal targets (i.e. examples).
50+
// swift-argument-parser only provides source compatibility guarantees between minor version.
5151
.package(url: "https://github.com/apple/swift-argument-parser", "0.3.0" ..< "0.5.0"),
5252
],
5353
targets: [
@@ -56,6 +56,9 @@ let package = Package(
5656
name: "GRPC",
5757
dependencies: [
5858
.product(name: "NIO", package: "swift-nio"),
59+
.product(name: "NIOCore", package: "swift-nio"),
60+
.product(name: "NIOPosix", package: "swift-nio"),
61+
.product(name: "NIOEmbedded", package: "swift-nio"),
5962
.product(name: "NIOFoundationCompat", package: "swift-nio"),
6063
.product(name: "NIOTransportServices", package: "swift-nio-transport-services"),
6164
.product(name: "NIOHTTP1", package: "swift-nio"),
@@ -76,6 +79,9 @@ let package = Package(
7679
.target(name: "GRPCSampleData"),
7780
.target(name: "GRPCInteroperabilityTestsImplementation"),
7881
.target(name: "HelloWorldModel"),
82+
.product(name: "NIOCore", package: "swift-nio"),
83+
.product(name: "NIOPosix", package: "swift-nio"),
84+
.product(name: "NIOEmbedded", package: "swift-nio"),
7985
]
8086
),
8187

Sources/GRPC/CallHandlers/BidirectionalStreamingServerHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHPACK
1818

1919
public final class BidirectionalStreamingServerHandler<

Sources/GRPC/CallHandlers/ClientStreamingServerHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHPACK
1818

1919
public final class ClientStreamingServerHandler<

Sources/GRPC/CallHandlers/ServerHandlerProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHPACK
1818

1919
/// This protocol lays out the inbound interface between the gRPC module and generated server code.

Sources/GRPC/CallHandlers/ServerStreamingServerHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHPACK
1818

1919
public final class ServerStreamingServerHandler<

Sources/GRPC/CallHandlers/UnaryServerHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHPACK
1818

1919
public final class UnaryServerHandler<

Sources/GRPC/CallOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import struct Foundation.UUID
1717
import Logging
18-
import NIO
18+
import NIOCore
1919
import NIOHPACK
2020
import NIOHTTP1
2121
import NIOHTTP2

Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
1818
import NIOHPACK
1919
import NIOHTTP2
2020

Sources/GRPC/ClientCalls/Call.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
1818
import NIOHPACK
1919
import NIOHTTP2
2020
import protocol SwiftProtobuf.Message

Sources/GRPC/ClientCalls/ClientCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Foundation
17-
import NIO
17+
import NIOCore
1818
import NIOHPACK
1919
import NIOHTTP1
2020
import NIOHTTP2

Sources/GRPC/ClientCalls/ClientStreamingCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
1818
import NIOHPACK
1919
import NIOHTTP2
2020

Sources/GRPC/ClientCalls/LazyEventLoopPromise.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
1716
import NIOConcurrencyHelpers
17+
import NIOCore
1818

1919
extension EventLoop {
2020
internal func makeLazyPromise<Value>(of: Value.Type = Value.self) -> LazyEventLoopPromise<Value> {

Sources/GRPC/ClientCalls/ResponseContainers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHPACK
1818

1919
/// A bucket of promises for a unary-response RPC.

Sources/GRPC/ClientCalls/ResponsePartContainer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHPACK
1818

1919
/// A container for RPC response parts.

Sources/GRPC/ClientCalls/ServerStreamingCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
1818
import NIOHPACK
1919
import NIOHTTP2
2020

Sources/GRPC/ClientCalls/UnaryCall.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import Foundation
1717
import Logging
18-
import NIO
18+
import NIOCore
1919
import NIOHPACK
2020
import NIOHTTP1
2121
import NIOHTTP2

Sources/GRPC/ClientConnection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import Foundation
1717
import Logging
18-
import NIO
18+
import NIOCore
1919
import NIOHTTP2
2020
import NIOSSL
2121
import NIOTLS

Sources/GRPC/Compression/Zlib.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import CGRPCZlib
1717
import struct Foundation.Data
18-
import NIO
18+
import NIOCore
1919

2020
/// Provides minimally configurable wrappers around zlib's compression and decompression
2121
/// functionality.

Sources/GRPC/ConnectionKeepalive.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717

1818
/// Provides keepalive pings.
1919
///

Sources/GRPC/ConnectionManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
import Foundation
1717
import Logging
18-
import NIO
1918
import NIOConcurrencyHelpers
19+
import NIOCore
2020
import NIOHTTP2
2121

2222
internal final class ConnectionManager {

Sources/GRPC/ConnectionManagerChannelProvider.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
18+
import NIOPosix
1819
import NIOSSL
1920
import NIOTransportServices
2021

Sources/GRPC/ConnectionPool/ConnectionPool+Waiter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHTTP2
1818

1919
extension ConnectionPool {

Sources/GRPC/ConnectionPool/ConnectionPool.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
1817
import NIOConcurrencyHelpers
18+
import NIOCore
1919
import NIOHTTP2
2020

2121
internal final class ConnectionPool {

Sources/GRPC/ConnectionPool/PoolManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
1817
import NIOConcurrencyHelpers
18+
import NIOCore
1919

2020
internal final class PoolManager {
2121
/// Configuration used for each connection pool.

Sources/GRPC/ConnectionPool/PoolManagerStateMachine+PerPoolState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717

1818
extension PoolManagerStateMachine.ActiveState {
1919
internal struct PerPoolState {

Sources/GRPC/ConnectionPool/PoolManagerStateMachine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717

1818
internal struct PoolManagerStateMachine {
1919
/// The current state.

Sources/GRPC/ConnectivityState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
import Foundation
1717
import Logging
18-
import NIO
1918
import NIOConcurrencyHelpers
19+
import NIOCore
2020

2121
/// The connectivity state of a client connection. Note that this is heavily lifted from the gRPC
2222
/// documentation: https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md.

Sources/GRPC/DelegatingErrorHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import Foundation
1717
import Logging
18-
import NIO
18+
import NIOCore
1919
import NIOSSL
2020

2121
/// A channel handler which allows caught errors to be passed to a `ClientErrorDelegate`. This

Sources/GRPC/FakeChannel.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
18+
import NIOEmbedded
1819
import SwiftProtobuf
1920

2021
/// A fake channel for use with generated test clients.

Sources/GRPC/GRPCChannel/EmbeddedGRPCChannel.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
18+
import NIOEmbedded
1819
import NIOHTTP2
1920
import SwiftProtobuf
2021

Sources/GRPC/GRPCChannel/GRPCChannel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHTTP2
1818
import NIOSSL
1919
import SwiftProtobuf

Sources/GRPC/GRPCChannel/GRPCChannelBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import Dispatch
1717
import Logging
18-
import NIO
18+
import NIOCore
1919
import NIOSSL
2020

2121
#if canImport(Security)

Sources/GRPC/GRPCClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHTTP2
1818
import SwiftProtobuf
1919

Sources/GRPC/GRPCClientChannelHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
1818
import NIOHPACK
1919
import NIOHTTP1
2020
import NIOHTTP2

Sources/GRPC/GRPCClientStateMachine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import Foundation
1717
import Logging
18-
import NIO
18+
import NIOCore
1919
import NIOHPACK
2020
import NIOHTTP1
2121
import SwiftProtobuf

Sources/GRPC/GRPCIdleHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
1818
import NIOHTTP2
1919

2020
internal final class GRPCIdleHandler: ChannelInboundHandler {

Sources/GRPC/GRPCIdleHandlerStateMachine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
1818
import NIOHTTP2
1919

2020
/// Holds state for the 'GRPCIdleHandler', this isn't really just the idleness of the connection,

Sources/GRPC/GRPCKeepaliveHandlers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
import NIO
16+
import NIOCore
1717
import NIOHTTP2
1818

1919
struct PingHandler {

Sources/GRPC/GRPCLogger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
import Logging
17-
import NIO
17+
import NIOCore
1818

1919
/// Wraps `Logger` to always provide the source as "GRPC".
2020
///

0 commit comments

Comments
 (0)