Skip to content

Use more specific NIO imports (#1239) #1241

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

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ let package = Package(
dependencies: [
// GRPC dependencies:
// Main SwiftNIO package
.package(url: "https://github.com/apple/swift-nio.git", from: "2.28.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.32.0"),
// HTTP2 via SwiftNIO
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.17.0"),
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.18.2"),
// TLS via SwiftNIO
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.14.0"),
// Support for Network.framework where possible.
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.6.0"),
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.11.1"),
// Extra NIO stuff; quiescing helpers.
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.4.0"),

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

// Argument parsering: only for internal targets (i.e. examples).
// swift-argument-parser only provides source compatability guarantees between minor version.
// Argument parsing: only for internal targets (i.e. examples).
// swift-argument-parser only provides source compatibility guarantees between minor version.
.package(url: "https://github.com/apple/swift-argument-parser", "0.3.0" ..< "0.5.0"),
],
targets: [
Expand All @@ -56,6 +56,9 @@ let package = Package(
name: "GRPC",
dependencies: [
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
.product(name: "NIOTransportServices", package: "swift-nio-transport-services"),
.product(name: "NIOHTTP1", package: "swift-nio"),
Expand All @@ -76,6 +79,9 @@ let package = Package(
.target(name: "GRPCSampleData"),
.target(name: "GRPCInteroperabilityTestsImplementation"),
.target(name: "HelloWorldModel"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOEmbedded", package: "swift-nio"),
]
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHPACK

public final class BidirectionalStreamingServerHandler<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHPACK

public final class ClientStreamingServerHandler<
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/CallHandlers/ServerHandlerProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHPACK

/// This protocol lays out the inbound interface between the gRPC module and generated server code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHPACK

public final class ServerStreamingServerHandler<
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/CallHandlers/UnaryServerHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHPACK

public final class UnaryServerHandler<
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/CallOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import struct Foundation.UUID
import Logging
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP1
import NIOHTTP2
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/BidirectionalStreamingCall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP2

Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/Call.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP2
import protocol SwiftProtobuf.Message
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/ClientCall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Foundation
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP1
import NIOHTTP2
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/ClientStreamingCall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP2

Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/LazyEventLoopPromise.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOConcurrencyHelpers
import NIOCore

extension EventLoop {
internal func makeLazyPromise<Value>(of: Value.Type = Value.self) -> LazyEventLoopPromise<Value> {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/ResponseContainers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHPACK

/// A bucket of promises for a unary-response RPC.
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/ResponsePartContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHPACK

/// A container for RPC response parts.
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/ServerStreamingCall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP2

Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientCalls/UnaryCall.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import Foundation
import Logging
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP1
import NIOHTTP2
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ClientConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import Foundation
import Logging
import NIO
import NIOCore
import NIOHTTP2
import NIOSSL
import NIOTLS
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/Compression/Zlib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import CGRPCZlib
import struct Foundation.Data
import NIO
import NIOCore

/// Provides minimally configurable wrappers around zlib's compression and decompression
/// functionality.
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ConnectionKeepalive.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore

/// Provides keepalive pings.
///
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ConnectionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
import Foundation
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOHTTP2

internal final class ConnectionManager {
Expand Down
3 changes: 2 additions & 1 deletion Sources/GRPC/ConnectionManagerChannelProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOPosix
import NIOSSL
import NIOTransportServices

Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ConnectionPool/ConnectionPool+Waiter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHTTP2

extension ConnectionPool {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ConnectionPool/ConnectionPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOHTTP2

internal final class ConnectionPool {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ConnectionPool/PoolManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore

internal final class PoolManager {
/// Configuration used for each connection pool.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore

extension PoolManagerStateMachine.ActiveState {
internal struct PerPoolState {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ConnectionPool/PoolManagerStateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore

internal struct PoolManagerStateMachine {
/// The current state.
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/ConnectivityState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
import Foundation
import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore

/// The connectivity state of a client connection. Note that this is heavily lifted from the gRPC
/// documentation: https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md.
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/DelegatingErrorHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import Foundation
import Logging
import NIO
import NIOCore
import NIOSSL

/// A channel handler which allows caught errors to be passed to a `ClientErrorDelegate`. This
Expand Down
3 changes: 2 additions & 1 deletion Sources/GRPC/FakeChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOEmbedded
import SwiftProtobuf

/// A fake channel for use with generated test clients.
Expand Down
3 changes: 2 additions & 1 deletion Sources/GRPC/GRPCChannel/EmbeddedGRPCChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP2
import SwiftProtobuf

Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCChannel/GRPCChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHTTP2
import NIOSSL
import SwiftProtobuf
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCChannel/GRPCChannelBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import Dispatch
import Logging
import NIO
import NIOCore
import NIOSSL

#if canImport(Security)
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHTTP2
import SwiftProtobuf

Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCClientChannelHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP1
import NIOHTTP2
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCClientStateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
import Foundation
import Logging
import NIO
import NIOCore
import NIOHPACK
import NIOHTTP1
import SwiftProtobuf
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCIdleHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOHTTP2

internal final class GRPCIdleHandler: ChannelInboundHandler {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCIdleHandlerStateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore
import NIOHTTP2

/// Holds state for the 'GRPCIdleHandler', this isn't really just the idleness of the connection,
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCKeepaliveHandlers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import NIO
import NIOCore
import NIOHTTP2

struct PingHandler {
Expand Down
2 changes: 1 addition & 1 deletion Sources/GRPC/GRPCLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import Logging
import NIO
import NIOCore

/// Wraps `Logger` to always provide the source as "GRPC".
///
Expand Down
Loading