mirror of
https://github.com/swift-server/RediStack.git
synced 2026-05-03 07:32:28 +00:00
Remove reliance on the NIO umbrella module (#60)
This commit is contained in:
+6
-2
@@ -32,8 +32,11 @@ let package = Package(
|
||||
.target(
|
||||
name: "RediStack",
|
||||
dependencies: [
|
||||
.product(name: "Atomics", package: "swift-atomics"),
|
||||
.product(name: "NIOCore", package: "swift-nio"),
|
||||
.product(name: "NIOPosix", package: "swift-nio"),
|
||||
.product(name: "NIO", package: "swift-nio"),
|
||||
.product(name: "NIOConcurrencyHelpers", package: "swift-nio"),
|
||||
.product(name: "Atomics", package: "swift-atomics"),
|
||||
.product(name: "Logging", package: "swift-log"),
|
||||
.product(name: "Metrics", package: "swift-metrics")
|
||||
]
|
||||
@@ -42,7 +45,8 @@ let package = Package(
|
||||
.target(
|
||||
name: "RediStackTestUtils",
|
||||
dependencies: [
|
||||
.product(name: "NIO", package: "swift-nio"),
|
||||
.product(name: "NIOCore", package: "swift-nio"),
|
||||
.product(name: "NIOEmbedded", package: "swift-nio"),
|
||||
"RediStack"
|
||||
]
|
||||
),
|
||||
|
||||
@@ -56,7 +56,7 @@ dependencies: [
|
||||
**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 = ...
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
/// Handles incoming byte messages from Redis
|
||||
/// and decodes them according to the Redis Serialization Protocol (RESP).
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
/// The `NIO.ChannelOutboundHandler.OutboundIn` type for `RedisCommandHandler`.
|
||||
///
|
||||
|
||||
@@ -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
|
||||
|
||||
/// A closure receiver of individual Pub/Sub messages from Redis subscriptions to channels and patterns.
|
||||
/// - Warning: The receiver is called on the same `NIO.EventLoop` that processed the message.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
extension RedisClient {
|
||||
/// Echos the provided message through the Redis instance.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
// MARK: Static Helpers
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
// MARK: General
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
// MARK: Publish
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
// MARK: General
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
// MARK: Static Helpers
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
// MARK: Get
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
import Foundation
|
||||
import Logging
|
||||
import NIO
|
||||
import NIOCore
|
||||
import NIOPosix
|
||||
|
||||
extension RedisConnection.Configuration {
|
||||
public struct ValidationError: LocalizedError, Equatable {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Logging
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
/// `ConnectionPool` is RediStack's internal representation of a pool of Redis connections.
|
||||
///
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import NIOPosix
|
||||
|
||||
// MARK: Convenience extensions
|
||||
|
||||
|
||||
@@ -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).
|
||||
///
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import struct Foundation.Data
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
/// A representation of a Redis Serialization Protocol (RESP) primitive value.
|
||||
///
|
||||
@@ -168,7 +168,7 @@ extension RESPValue: RESPValueConvertible {
|
||||
|
||||
// MARK: EventLoopFuture Extensions
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
extension EventLoopFuture where Value == RESPValue {
|
||||
/// Attempts to convert the resolved RESPValue to the desired type.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
import protocol Foundation.LocalizedError
|
||||
import struct Logging.Logger
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
// - Important: Any RedisClient defined by RediStack should conform to the RedisClientWithUserContext protocol as well
|
||||
|
||||
|
||||
@@ -17,8 +17,9 @@ import struct Dispatch.DispatchTime
|
||||
import Atomics
|
||||
import Logging
|
||||
import Metrics
|
||||
import NIO
|
||||
import NIOCore
|
||||
import NIOConcurrencyHelpers
|
||||
import NIOPosix
|
||||
|
||||
extension RedisConnection {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
import struct Foundation.UUID
|
||||
import NIO
|
||||
import NIOCore
|
||||
import NIOConcurrencyHelpers
|
||||
import Logging
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
extension RedisKey.Lifetime {
|
||||
/// The lifetime duration for a `RedisKey` which has an expiry set.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Logging
|
||||
import NIO
|
||||
import NIOCore
|
||||
import NIOPosix
|
||||
|
||||
extension RedisConnection {
|
||||
/// The documented default port that Redis connects through.
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
import RediStack
|
||||
import XCTest
|
||||
import NIO
|
||||
import NIOCore
|
||||
import NIOEmbedded
|
||||
|
||||
internal enum MockConnectionPoolError: Error {
|
||||
case unexpectedMessage
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
|
||||
private let allocator = ByteBufferAllocator()
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Foundation
|
||||
import NIO
|
||||
import NIOCore
|
||||
import RediStack
|
||||
|
||||
extension RedisConnection.Configuration {
|
||||
|
||||
@@ -12,9 +12,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import RediStack
|
||||
import XCTest
|
||||
import NIOPosix
|
||||
|
||||
/// A helper `XCTestCase` subclass that does the standard work of creating a connection pool to use in test cases.
|
||||
///
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import RediStack
|
||||
import NIOPosix
|
||||
import XCTest
|
||||
|
||||
/// A helper `XCTestCase` subclass that does the standard work of creating a connection to use in test cases.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import RediStack
|
||||
|
||||
extension RedisConnection {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import RediStack
|
||||
|
||||
extension RedisClient {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import RediStack
|
||||
import RediStackTestUtils
|
||||
import XCTest
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
@testable import RediStack
|
||||
import RediStackTestUtils
|
||||
import XCTest
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import Logging
|
||||
@testable import RediStack
|
||||
import RediStackTestUtils
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import NIOEmbedded
|
||||
import NIOTestUtils
|
||||
@testable import RediStack
|
||||
import XCTest
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import NIO
|
||||
import NIOCore
|
||||
import NIOEmbedded
|
||||
@testable import RediStack
|
||||
import RediStackTestUtils
|
||||
import XCTest
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -143,10 +143,10 @@ done
|
||||
rm "$tmp"
|
||||
|
||||
# This checks for the umbrella NIO module.
|
||||
#printf "=> Checking for imports of umbrella NIO module... "
|
||||
#if git grep --color=never -i "^[ \t]*import \+NIO[ \t]*$" > /dev/null; then
|
||||
# printf "\033[0;31mUmbrella imports found.\033[0m\n"
|
||||
# git grep -i "^[ \t]*import \+NIO[ \t]*$"
|
||||
# exit 1
|
||||
#fi
|
||||
#printf "\033[0;32mokay.\033[0m\n"
|
||||
printf "=> Checking for imports of umbrella NIO module... "
|
||||
if git grep --color=never -i "^[ \t]*import \+NIO[ \t]*$" > /dev/null; then
|
||||
printf "\033[0;31mUmbrella imports found.\033[0m\n"
|
||||
git grep -i "^[ \t]*import \+NIO[ \t]*$"
|
||||
exit 1
|
||||
fi
|
||||
printf "\033[0;32mokay.\033[0m\n"
|
||||
|
||||
Reference in New Issue
Block a user