@@ -12,9 +12,10 @@ public final class RedisConnection {
1212 public let channel : Channel
1313
1414 /// 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 )
1617
17- deinit { assert ( isClosed . load ( ) , " Redis connection was not properly shut down! " ) }
18+ deinit { assert ( _isClosed . load ( ) , " Redis connection was not properly shut down! " ) }
1819
1920 /// Creates a new connection on the provided channel.
2021 /// - Note: This connection will take ownership of the `Channel` object.
@@ -27,7 +28,7 @@ public final class RedisConnection {
2728 /// - Returns: An `EventLoopFuture` that resolves when the connection has been closed.
2829 @discardableResult
2930 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: ( ) ) }
3132
3233 let promise = channel. eventLoop. makePromise ( of: Void . self)
3334
@@ -53,7 +54,7 @@ public final class RedisConnection {
5354 /// - arguments: The arguments to be sent with the command.
5455 /// - Returns: An `EventLoopFuture` that will resolve with the Redis command response.
5556 public func command( _ command: String , arguments: [ RESPValue ] = [ ] ) -> EventLoopFuture < RESPValue > {
56- guard !isClosed . load ( ) else {
57+ guard !_isClosed . load ( ) else {
5758 return channel. eventLoop. makeFailedFuture ( error: RedisError . connectionClosed)
5859 }
5960
0 commit comments