@@ -12,9 +12,10 @@ public final class RedisConnection {
12
12
public let channel : Channel
13
13
14
14
/// Has the connection been closed?
15
- public private( set) var isClosed = Atomic < Bool > ( value: false )
15
+ public var isClosed : Bool { return _isClosed. load ( ) }
16
+ private var _isClosed = Atomic < Bool > ( value: false )
16
17
17
- deinit { assert ( isClosed . load ( ) , " Redis connection was not properly shut down! " ) }
18
+ deinit { assert ( _isClosed . load ( ) , " Redis connection was not properly shut down! " ) }
18
19
19
20
/// Creates a new connection on the provided channel.
20
21
/// - Note: This connection will take ownership of the `Channel` object.
@@ -27,7 +28,7 @@ public final class RedisConnection {
27
28
/// - Returns: An `EventLoopFuture` that resolves when the connection has been closed.
28
29
@discardableResult
29
30
public func close( ) -> EventLoopFuture < Void > {
30
- guard isClosed . exchange ( with: true ) else { return channel. eventLoop. makeSucceededFuture ( result: ( ) ) }
31
+ guard _isClosed . exchange ( with: true ) else { return channel. eventLoop. makeSucceededFuture ( result: ( ) ) }
31
32
32
33
let promise = channel. eventLoop. makePromise ( of: Void . self)
33
34
@@ -53,7 +54,7 @@ public final class RedisConnection {
53
54
/// - arguments: The arguments to be sent with the command.
54
55
/// - Returns: An `EventLoopFuture` that will resolve with the Redis command response.
55
56
public func command( _ command: String , arguments: [ RESPValue ] = [ ] ) -> EventLoopFuture < RESPValue > {
56
- guard !isClosed . load ( ) else {
57
+ guard !_isClosed . load ( ) else {
57
58
return channel. eventLoop. makeFailedFuture ( error: RedisError . connectionClosed)
58
59
}
59
60
0 commit comments