Explicitly depend on NIO modules

This commit is contained in:
Fabian Fett
2022-12-01 13:46:41 +01:00
parent d0f15ad55b
commit c366a16fe8
45 changed files with 81 additions and 63 deletions
+9 -4
View File
@@ -34,7 +34,8 @@ let package = Package(
name: "RediStack",
dependencies: [
.product(name: "Atomics", package: "swift-atomics"),
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "Logging", package: "swift-log"),
.product(name: "Metrics", package: "swift-metrics"),
.product(name: "ServiceDiscovery", package: "swift-service-discovery")
@@ -44,7 +45,9 @@ let package = Package(
name: "RediStackTests",
dependencies: [
"RediStack", "RediStackTestUtils",
.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: "NIOTestUtils", package: "swift-nio")
]
),
@@ -54,14 +57,16 @@ let package = Package(
name: "RedisTypesTests",
dependencies: [
"RediStack", "RedisTypes", "RediStackTestUtils",
.product(name: "NIO", package: "swift-nio")
.product(name: "NIOCore", package: "swift-nio")
]
),
.target(
name: "RediStackTestUtils",
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"),
"RediStack"
]
),
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// Handles incoming byte messages from Redis
/// and decodes them according to the Redis Serialization Protocol (RESP).
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019-2020 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// An object that operates in a First In, First Out (FIFO) request-response cycle.
///
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
#if DEBUG
// used only for debugging purposes where we build a formatted string for the encoded bytes
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
/// The possible events that are received from Redis Pub/Sub channels.
public enum RedisPubSubEvent {
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Logging.Logger
import NIO
import NIOCore
// MARK: Connection
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Logging.Logger
import NIO
import NIOCore
// MARK: Hashes
+1 -1
View File
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Logging.Logger
import NIO
import NIOCore
// MARK: Key
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
// MARK: Lists
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Logging.Logger
import NIO
import NIOCore
// MARK: PubSub
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Logging.Logger
import NIO
import NIOCore
// MARK: Server
+1 -1
View File
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Logging.Logger
import NIO
import NIOCore
// MARK: Sets
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Logging.Logger
import NIO
import NIOCore
// MARK: Sorted Sets
@@ -14,7 +14,7 @@
import struct Logging.Logger
import Foundation
import NIO
import NIOCore
// MARK: Strings
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import Logging
import NIO
import NIOCore
/// `ConnectionPool` is RediStack's internal representation of a pool of Redis connections.
///
@@ -7,7 +7,7 @@ A non-blocking Swift client for Redis built on top of SwiftNIO.
**RediStack** is quick to use - all you need is an [`EventLoop`](https://apple.github.io/swift-nio/docs/current/NIO/Protocols/EventLoop.html) from **SwiftNIO**.
```swift
import NIO
import NIOCore
import RediStack
let eventLoop: EventLoop = ...
+2 -1
View File
@@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOPosix
// MARK: Convenience extensions
+2 -2
View File
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import protocol Foundation.LocalizedError
import NIO
import NIOCore
/// A helper object for translating between raw bytes and Swift types according to the Redis Serialization Protocol (RESP).
///
+2 -2
View File
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019-2020 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Foundation.Data
import NIO
import NIOCore
/// A representation of a Redis Serialization Protocol (RESP) primitive value.
///
+1 -1
View File
@@ -14,7 +14,7 @@
import protocol Foundation.LocalizedError
import struct Logging.Logger
import NIO
import NIOCore
/// An object capable of sending commands and receiving responses.
///
@@ -14,7 +14,7 @@
import Foundation
import Logging
import NIO
import NIOCore
extension RedisConnection.Configuration {
public struct ValidationError: LocalizedError, Equatable {
+2 -1
View File
@@ -17,8 +17,9 @@ import struct Dispatch.DispatchTime
import Atomics
import Logging
import Metrics
import NIO
import NIOCore
import NIOConcurrencyHelpers
import NIOPosix
extension RedisConnection {
@@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import Logging
import NIO
import NIOCore
import NIOPosix
// MARK: - Pool Connection Congfiguration
+1 -1
View File
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import struct Foundation.UUID
import NIO
import NIOCore
import NIOConcurrencyHelpers
import Logging
import ServiceDiscovery
+2 -2
View File
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2020 RediStack project authors
// Copyright (c) 2020-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
extension RedisKey.Lifetime {
/// The lifetime duration for a `RedisKey` which has an expiry set.
+1 -1
View File
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import Logging
import NIO
import NIOCore
/// The system funnel for all `Logging` static details such as labels, `Logging.Logger` prototypes, and metadata keys used by RediStack.
public enum RedisLogging {
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2020 RediStack project authors
// Copyright (c) 2020-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -14,7 +14,8 @@
import RediStack
import XCTest
import NIO
import NIOCore
import NIOEmbedded
internal enum MockConnectionPoolError: Error {
case unexpectedMessage
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
private let allocator = ByteBufferAllocator()
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019-2020 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import Foundation
import NIO
import NIOCore
import RediStack
extension RedisConnection.Configuration {
@@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import Logging
import NIO
import NIOCore
import NIOPosix
import RediStack
import XCTest
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019-2020 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOPosix
import RediStack
import XCTest
+1 -1
View File
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Logging.Logger
import NIO
import NIOCore
import RediStack
extension RedisClient {
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOEmbedded
@testable import RediStack
import RediStackTestUtils
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019-2020 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
@testable import RediStack
import RediStackTestUtils
import XCTest
@@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOPosix
import Logging
@testable import RediStack
import RediStackTestUtils
@@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOPosix
@testable import RediStack
import RediStackTestUtils
import XCTest
@@ -14,7 +14,7 @@
import Logging
import ServiceDiscovery
import NIO
import NIOCore
import RediStack
import RediStackTestUtils
import XCTest
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import ServiceDiscovery
import NIO
import NIOCore
import Logging
@testable import RediStack
import RediStackTestUtils
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOEmbedded
import NIOTestUtils
@testable import RediStack
import XCTest
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019-2020 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOPosix
@testable import RediStack
import XCTest
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,8 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import NIOEmbedded
@testable import RediStack
import RediStackTestUtils
import XCTest
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2020 RediStack project authors
// Copyright (c) 2020-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
import NIO
import NIOCore
import RediStack
import XCTest
@@ -15,7 +15,8 @@
@testable import RediStack
@testable import RediStackTestUtils
import XCTest
import NIO
import NIOCore
import NIOEmbedded
enum ConnectionPoolTestError: Error {
case connectionFailedForSomeReason
@@ -2,7 +2,7 @@
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019 RediStack project authors
// Copyright (c) 2019-2022 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
@@ -13,7 +13,7 @@
//===----------------------------------------------------------------------===//
import struct Foundation.Data
import NIO
import NIOCore
@testable import RediStack
import XCTest
@@ -13,7 +13,8 @@
//===----------------------------------------------------------------------===//
import Logging
import NIO
import NIOCore
import NIOEmbedded
@testable import RediStack
import XCTest