Skip to content

Commit 0007a08

Browse files
committed
Merge branch 'isconnected-req' into 'master'
Add `isConnected` property to `RedisClient` protocol See merge request Mordil/swift-redi-stack!95
2 parents a5f9d76 + a50a4d5 commit 0007a08

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Sources/RediStack/RedisClient.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ import NIO
2323
///
2424
/// See [https://redis.io/commands](https://redis.io/commands)
2525
public protocol RedisClient {
26-
/// The `EventLoop` that this client operates on.
26+
/// Is the client currently connected to Redis?
27+
var isConnected: Bool { get }
28+
29+
/// The `NIO.EventLoop` that this client operates on.
2730
var eventLoop: EventLoop { get }
2831

2932
/// The `Logging.Logger` that this client uses.
@@ -33,7 +36,7 @@ public protocol RedisClient {
3336
/// - Parameters:
3437
/// - command: The command to execute.
3538
/// - arguments: The arguments, if any, to be sent with the command.
36-
/// - Returns: An `EventLoopFuture` that will resolve with the Redis command response.
39+
/// - Returns: A `NIO.EventLoopFuture` that will resolve with the Redis command response.
3740
func send(command: String, with arguments: [RESPValue]) -> EventLoopFuture<RESPValue>
3841

3942
/// Updates the client's logger.
@@ -44,7 +47,7 @@ public protocol RedisClient {
4447
extension RedisClient {
4548
/// Sends the desired command without arguments.
4649
/// - Parameter command: The command keyword to execute.
47-
/// - Returns: An `EventLoopFuture` that will resolve with the Redis command response.
50+
/// - Returns: A `NIO.EventLoopFuture` that will resolve with the Redis command response.
4851
public func send(command: String) -> EventLoopFuture<RESPValue> {
4952
return self.send(command: command, with: [])
5053
}

Sources/RediStack/RedisConnection.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ public final class RedisConnection: RedisClient {
105105
}
106106
}
107107
public var eventLoop: EventLoop { return self.channel.eventLoop }
108-
/// Is the connection to Redis still open?
109108
public var isConnected: Bool {
110109
// `Channel.isActive` is set to false before the `closeFuture` resolves in cases where the channel might be
111110
// closed, or closing, before our state has been updated

0 commit comments

Comments
 (0)