Skip to content

Commit 1c0ee4f

Browse files
committed
Update DispatchRedis module with new classes
1 parent 1db5a04 commit 1c0ee4f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Sources/DispatchRedis/Redis.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import NIORedis
44

55
/// A factory that handles all necessary details for creating `RedisConnection` instances.
66
public final class Redis {
7-
private let driver: NIORedis
7+
private let driver: RedisDriver
88

99
deinit { try? driver.terminate() }
1010

1111
public init(threadCount: Int = 1) {
12-
self.driver = NIORedis(executionModel: .spawnThreads(threadCount))
12+
self.driver = RedisDriver(executionModel: .spawnThreads(threadCount))
1313
}
1414

1515
public func makeConnection(

Sources/DispatchRedis/RedisConnection.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import Foundation
22
import NIORedis
33

44
public final class RedisConnection {
5-
let _driverConnection: NIORedisConnection
5+
let _driverConnection: NIORedis.RedisConnection
66

77
private let queue: DispatchQueue
88

99
deinit { _driverConnection.close() }
1010

11-
init(driver: NIORedisConnection, callbackQueue: DispatchQueue) {
11+
init(driver: NIORedis.RedisConnection, callbackQueue: DispatchQueue) {
1212
self._driverConnection = driver
1313
self.queue = callbackQueue
1414
}
1515

1616
/// Creates a `RedisPipeline` for executing a batch of commands.
1717
public func makePipeline(callbackQueue: DispatchQueue? = nil) -> RedisPipeline {
18-
return .init(using: self, callbackQueue: callbackQueue ?? queue)
18+
return .init(connection: self, callbackQueue: callbackQueue ?? queue)
1919
}
2020

2121
public func get(

Sources/DispatchRedis/RedisPipeline.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ import NIORedis
1414
/// - Important: The larger the pipeline queue, the more memory both the Redis driver and Redis server will use.
1515
/// See https://redis.io/topics/pipelining#redis-pipelining
1616
public final class RedisPipeline {
17-
private let _driverPipeline: NIORedisPipeline
17+
private let _driverPipeline: NIORedis.RedisPipeline
1818
private let queue: DispatchQueue
1919

2020
/// Creates a new pipeline queue using the provided `RedisConnection`, executing callbacks on the provided `DispatchQueue`.
2121
/// - Parameters:
2222
/// - using: The connection to execute the commands on.
2323
/// - callbackQueue: The queue to execute all callbacks on.
24-
public init(using connection: RedisConnection, callbackQueue: DispatchQueue) {
25-
self._driverPipeline = NIORedisPipeline(using: connection._driverConnection)
24+
public init(connection: RedisConnection, callbackQueue: DispatchQueue) {
25+
self._driverPipeline = NIORedis.RedisPipeline(channel: connection._driverConnection.channel)
2626
self.queue = callbackQueue
2727
}
2828

0 commit comments

Comments
 (0)