Commit b5812484 authored by Nathan Harris's avatar Nathan Harris

Merge branch '50-rename-map' into 'master'

50 -- Rename `EventLoopFuture.mapFromRESP` to `convertFromRESPValue`

Closes #50

See merge request Mordil/swift-redis-nio-client!60
parents e0e5a689 c010e13b
Pipeline #67836491 failed with stages
in 4 minutes and 19 seconds
...@@ -23,7 +23,7 @@ extension RedisClient { ...@@ -23,7 +23,7 @@ extension RedisClient {
@inlinable @inlinable
public func echo(_ message: String) -> EventLoopFuture<String> { public func echo(_ message: String) -> EventLoopFuture<String> {
return send(command: "ECHO", with: [message]) return send(command: "ECHO", with: [message])
.mapFromRESP() .convertFromRESPValue()
} }
/// Pings the server, which will respond with a message. /// Pings the server, which will respond with a message.
...@@ -35,7 +35,7 @@ extension RedisClient { ...@@ -35,7 +35,7 @@ extension RedisClient {
public func ping(with message: String? = nil) -> EventLoopFuture<String> { public func ping(with message: String? = nil) -> EventLoopFuture<String> {
let arg = message != nil ? [message] : [] let arg = message != nil ? [message] : []
return send(command: "PING", with: arg) return send(command: "PING", with: arg)
.mapFromRESP() .convertFromRESPValue()
} }
/// Select the Redis logical database having the specified zero-based numeric index. /// Select the Redis logical database having the specified zero-based numeric index.
...@@ -61,7 +61,7 @@ extension RedisClient { ...@@ -61,7 +61,7 @@ extension RedisClient {
public func swapDatabase(_ first: Int, with second: Int) -> EventLoopFuture<Bool> { public func swapDatabase(_ first: Int, with second: Int) -> EventLoopFuture<Bool> {
/// connection.swapDatabase(index: 0, withIndex: 10) /// connection.swapDatabase(index: 0, withIndex: 10)
return send(command: "SWAPDB", with: [first, second]) return send(command: "SWAPDB", with: [first, second])
.mapFromRESP(to: String.self) .convertFromRESPValue(to: String.self)
.map { return $0 == "OK" } .map { return $0 == "OK" }
} }
...@@ -75,7 +75,7 @@ extension RedisClient { ...@@ -75,7 +75,7 @@ extension RedisClient {
guard keys.count > 0 else { return self.eventLoop.makeSucceededFuture(0) } guard keys.count > 0 else { return self.eventLoop.makeSucceededFuture(0) }
return send(command: "DEL", with: keys) return send(command: "DEL", with: keys)
.mapFromRESP() .convertFromRESPValue()
} }
/// Sets a timeout on key. After the timeout has expired, the key will automatically be deleted. /// Sets a timeout on key. After the timeout has expired, the key will automatically be deleted.
...@@ -90,7 +90,7 @@ extension RedisClient { ...@@ -90,7 +90,7 @@ extension RedisClient {
public func expire(_ key: String, after deadline: TimeAmount) -> EventLoopFuture<Bool> { public func expire(_ key: String, after deadline: TimeAmount) -> EventLoopFuture<Bool> {
let amount = deadline.nanoseconds / 1_000_000_000 let amount = deadline.nanoseconds / 1_000_000_000
return send(command: "EXPIRE", with: [key, amount]) return send(command: "EXPIRE", with: [key, amount])
.mapFromRESP(to: Int.self) .convertFromRESPValue(to: Int.self)
.map { return $0 == 1 } .map { return $0 == 1 }
} }
} }
...@@ -142,7 +142,7 @@ extension RedisClient { ...@@ -142,7 +142,7 @@ extension RedisClient {
args.append(c) args.append(c)
} }
let response = send(command: command, with: args).mapFromRESP(to: [RESPValue].self) let response = send(command: command, with: args).convertFromRESPValue(to: [RESPValue].self)
let position = response.flatMapThrowing { result -> Int in let position = response.flatMapThrowing { result -> Int in
guard guard
let value = result[0].string, let value = result[0].string,
...@@ -154,7 +154,7 @@ extension RedisClient { ...@@ -154,7 +154,7 @@ extension RedisClient {
} }
let elements = response let elements = response
.map { return $0[1] } .map { return $0[1] }
.mapFromRESP(to: resultType) .convertFromRESPValue(to: resultType)
return position.and(elements) return position.and(elements)
} }
......
...@@ -50,7 +50,7 @@ extension RedisClient { ...@@ -50,7 +50,7 @@ extension RedisClient {
guard fields.count > 0 else { return self.eventLoop.makeSucceededFuture(0) } guard fields.count > 0 else { return self.eventLoop.makeSucceededFuture(0) }
return send(command: "HDEL", with: [key] + fields) return send(command: "HDEL", with: [key] + fields)
.mapFromRESP() .convertFromRESPValue()
} }
/// Checks if a hash contains the field specified. /// Checks if a hash contains the field specified.
...@@ -63,7 +63,7 @@ extension RedisClient { ...@@ -63,7 +63,7 @@ extension RedisClient {
@inlinable @inlinable
public func hexists(_ field: String, in key: String) -> EventLoopFuture<Bool> { public func hexists(_ field: String, in key: String) -> EventLoopFuture<Bool> {
return send(command: "HEXISTS", with: [key, field]) return send(command: "HEXISTS", with: [key, field])
.mapFromRESP(to: Int.self) .convertFromRESPValue(to: Int.self)
.map { return $0 == 1 } .map { return $0 == 1 }
} }
...@@ -75,7 +75,7 @@ extension RedisClient { ...@@ -75,7 +75,7 @@ extension RedisClient {
@inlinable @inlinable
public func hlen(of key: String) -> EventLoopFuture<Int> { public func hlen(of key: String) -> EventLoopFuture<Int> {
return send(command: "HLEN", with: [key]) return send(command: "HLEN", with: [key])
.mapFromRESP() .convertFromRESPValue()
} }
/// Gets the string length of a hash field's value. /// Gets the string length of a hash field's value.
...@@ -88,7 +88,7 @@ extension RedisClient { ...@@ -88,7 +88,7 @@ extension RedisClient {
@inlinable @inlinable
public func hstrlen(of field: String, in key: String) -> EventLoopFuture<Int> { public func hstrlen(of field: String, in key: String) -> EventLoopFuture<Int> {
return send(command: "HSTRLEN", with: [key, field]) return send(command: "HSTRLEN", with: [key, field])
.mapFromRESP() .convertFromRESPValue()
} }
/// Gets all field names in a hash. /// Gets all field names in a hash.
...@@ -99,7 +99,7 @@ extension RedisClient { ...@@ -99,7 +99,7 @@ extension RedisClient {
@inlinable @inlinable
public func hkeys(in key: String) -> EventLoopFuture<[String]> { public func hkeys(in key: String) -> EventLoopFuture<[String]> {
return send(command: "HKEYS", with: [key]) return send(command: "HKEYS", with: [key])
.mapFromRESP() .convertFromRESPValue()
} }
/// Gets all values stored in a hash. /// Gets all values stored in a hash.
...@@ -110,7 +110,7 @@ extension RedisClient { ...@@ -110,7 +110,7 @@ extension RedisClient {
@inlinable @inlinable
public func hvals(in key: String) -> EventLoopFuture<[RESPValue]> { public func hvals(in key: String) -> EventLoopFuture<[RESPValue]> {
return send(command: "HVALS", with: [key]) return send(command: "HVALS", with: [key])
.mapFromRESP() .convertFromRESPValue()
} }
/// Incrementally iterates over all fields in a hash. /// Incrementally iterates over all fields in a hash.
...@@ -156,7 +156,7 @@ extension RedisClient { ...@@ -156,7 +156,7 @@ extension RedisClient {
in key: String in key: String
) -> EventLoopFuture<Bool> { ) -> EventLoopFuture<Bool> {
return send(command: "HSET", with: [key, field, value]) return send(command: "HSET", with: [key, field, value])
.mapFromRESP(to: Int.self) .convertFromRESPValue(to: Int.self)
.map { return $0 == 1 } .map { return $0 == 1 }
} }
...@@ -176,7 +176,7 @@ extension RedisClient { ...@@ -176,7 +176,7 @@ extension RedisClient {
in key: String in key: String
) -> EventLoopFuture<Bool> { ) -> EventLoopFuture<Bool> {
return send(command: "HSETNX", with: [key, field, value]) return send(command: "HSETNX", with: [key, field, value])
.mapFromRESP(to: Int.self) .convertFromRESPValue(to: Int.self)
.map { return $0 == 1 } .map { return $0 == 1 }
} }
...@@ -232,7 +232,7 @@ extension RedisClient { ...@@ -232,7 +232,7 @@ extension RedisClient {
guard fields.count > 0 else { return self.eventLoop.makeSucceededFuture([]) } guard fields.count > 0 else { return self.eventLoop.makeSucceededFuture([]) }
return send(command: "HMGET", with: [key] + fields) return send(command: "HMGET", with: [key] + fields)
.mapFromRESP(to: [RESPValue].self) .convertFromRESPValue(to: [RESPValue].self)
.map { return $0.map(String.init) } .map { return $0.map(String.init) }
} }
...@@ -244,7 +244,7 @@ extension RedisClient { ...@@ -244,7 +244,7 @@ extension RedisClient {
@inlinable @inlinable
public func hgetall(from key: String) -> EventLoopFuture<[String: String]> { public func hgetall(from key: String) -> EventLoopFuture<[String: String]> {
return send(command: "HGETALL", with: [key]) return send(command: "HGETALL", with: [key])
.mapFromRESP(to: [String].self) .convertFromRESPValue(to: [String].self)
.map(Self._mapHashResponse) .map(Self._mapHashResponse)
} }
} }
...@@ -264,7 +264,7 @@ extension RedisClient { ...@@ -264,7 +264,7 @@ extension RedisClient {
public func hincrby(_ amount: Int, field: String, in key: String) -> EventLoopFuture<Int> { public func hincrby(_ amount: Int, field: String, in key: String) -> EventLoopFuture<Int> {
/// connection.hincrby(20, field: "foo", in: "key") /// connection.hincrby(20, field: "foo", in: "key")
return send(command: "HINCRBY", with: [key, field, amount]) return send(command: "HINCRBY", with: [key, field, amount])
.mapFromRESP() .convertFromRESPValue()
} }
/// Increments a hash field's value and returns the new value. /// Increments a hash field's value and returns the new value.
...@@ -282,6 +282,6 @@ extension RedisClient { ...@@ -282,6 +282,6 @@ extension RedisClient {
T: RESPValueConvertible T: RESPValueConvertible
{ {
return send(command: "HINCRBYFLOAT", with: [key, field, amount]) return send(command: "HINCRBYFLOAT", with: [key, field, amount])
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -25,7 +25,7 @@ extension RedisClient { ...@@ -25,7 +25,7 @@ extension RedisClient {
@inlinable @inlinable
public func llen(of key: String) -> EventLoopFuture<Int> { public func llen(of key: String) -> EventLoopFuture<Int> {
return send(command: "LLEN", with: [key]) return send(command: "LLEN", with: [key])
.mapFromRESP() .convertFromRESPValue()
} }
/// Gets the element from a list stored at the provided index position. /// Gets the element from a list stored at the provided index position.
...@@ -73,7 +73,7 @@ extension RedisClient { ...@@ -73,7 +73,7 @@ extension RedisClient {
count: Int = 0 count: Int = 0
) -> EventLoopFuture<Int> { ) -> EventLoopFuture<Int> {
return send(command: "LREM", with: [key, count, value]) return send(command: "LREM", with: [key, count, value])
.mapFromRESP() .convertFromRESPValue()
} }
/// Trims a list to only contain elements within the specified inclusive bounds of 0-based indices. /// Trims a list to only contain elements within the specified inclusive bounds of 0-based indices.
...@@ -103,7 +103,7 @@ extension RedisClient { ...@@ -103,7 +103,7 @@ extension RedisClient {
from key: String from key: String
) -> EventLoopFuture<[RESPValue]> { ) -> EventLoopFuture<[RESPValue]> {
return send(command: "LRANGE", with: [key, range.startIndex, range.endIndex]) return send(command: "LRANGE", with: [key, range.startIndex, range.endIndex])
.mapFromRESP() .convertFromRESPValue()
} }
/// Pops the last element from a source list and pushes it to a destination list. /// Pops the last element from a source list and pushes it to a destination list.
...@@ -187,7 +187,7 @@ extension RedisClient { ...@@ -187,7 +187,7 @@ extension RedisClient {
_ pivot: RESPValueConvertible _ pivot: RESPValueConvertible
) -> EventLoopFuture<Int> { ) -> EventLoopFuture<Int> {
return send(command: "LINSERT", with: [key, pivotKeyword, pivot, element]) return send(command: "LINSERT", with: [key, pivotKeyword, pivot, element])
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -217,7 +217,7 @@ extension RedisClient { ...@@ -217,7 +217,7 @@ extension RedisClient {
assert(elements.count > 0, "At least 1 element should be provided.") assert(elements.count > 0, "At least 1 element should be provided.")
return send(command: "LPUSH", with: [key] + elements) return send(command: "LPUSH", with: [key] + elements)
.mapFromRESP() .convertFromRESPValue()
} }
/// Pushes an element into a list, but only if the key exists and holds a list. /// Pushes an element into a list, but only if the key exists and holds a list.
...@@ -231,7 +231,7 @@ extension RedisClient { ...@@ -231,7 +231,7 @@ extension RedisClient {
@inlinable @inlinable
public func lpushx(_ element: RESPValueConvertible, into key: String) -> EventLoopFuture<Int> { public func lpushx(_ element: RESPValueConvertible, into key: String) -> EventLoopFuture<Int> {
return send(command: "LPUSHX", with: [key, element]) return send(command: "LPUSHX", with: [key, element])
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -260,7 +260,7 @@ extension RedisClient { ...@@ -260,7 +260,7 @@ extension RedisClient {
assert(elements.count > 0, "At least 1 element should be provided.") assert(elements.count > 0, "At least 1 element should be provided.")
return send(command: "RPUSH", with: [key] + elements) return send(command: "RPUSH", with: [key] + elements)
.mapFromRESP() .convertFromRESPValue()
} }
/// Pushes an element into a list, but only if the key exists and holds a list. /// Pushes an element into a list, but only if the key exists and holds a list.
...@@ -274,7 +274,7 @@ extension RedisClient { ...@@ -274,7 +274,7 @@ extension RedisClient {
@inlinable @inlinable
public func rpushx(_ element: RESPValueConvertible, into key: String) -> EventLoopFuture<Int> { public func rpushx(_ element: RESPValueConvertible, into key: String) -> EventLoopFuture<Int> {
return send(command: "RPUSHX", with: [key, element]) return send(command: "RPUSHX", with: [key, element])
.mapFromRESP() .convertFromRESPValue()
} }
} }
......
...@@ -28,7 +28,7 @@ extension RedisClient { ...@@ -28,7 +28,7 @@ extension RedisClient {
@inlinable @inlinable
public func smembers(of key: String) -> EventLoopFuture<[RESPValue]> { public func smembers(of key: String) -> EventLoopFuture<[RESPValue]> {
return send(command: "SMEMBERS", with: [key]) return send(command: "SMEMBERS", with: [key])
.mapFromRESP() .convertFromRESPValue()
} }
/// Checks if the element is included in a set. /// Checks if the element is included in a set.
...@@ -41,7 +41,7 @@ extension RedisClient { ...@@ -41,7 +41,7 @@ extension RedisClient {
@inlinable @inlinable
public func sismember(_ element: RESPValueConvertible, of key: String) -> EventLoopFuture<Bool> { public func sismember(_ element: RESPValueConvertible, of key: String) -> EventLoopFuture<Bool> {
return send(command: "SISMEMBER", with: [key, element]) return send(command: "SISMEMBER", with: [key, element])
.mapFromRESP(to: Int.self) .convertFromRESPValue(to: Int.self)
.map { return $0 == 1 } .map { return $0 == 1 }
} }
...@@ -53,7 +53,7 @@ extension RedisClient { ...@@ -53,7 +53,7 @@ extension RedisClient {
@inlinable @inlinable
public func scard(of key: String) -> EventLoopFuture<Int> { public func scard(of key: String) -> EventLoopFuture<Int> {
return send(command: "SCARD", with: [key]) return send(command: "SCARD", with: [key])
.mapFromRESP() .convertFromRESPValue()
} }
/// Adds elements to a set. /// Adds elements to a set.
...@@ -68,7 +68,7 @@ extension RedisClient { ...@@ -68,7 +68,7 @@ extension RedisClient {
guard elements.count > 0 else { return self.eventLoop.makeSucceededFuture(0) } guard elements.count > 0 else { return self.eventLoop.makeSucceededFuture(0) }
return send(command: "SADD", with: [key] + elements) return send(command: "SADD", with: [key] + elements)
.mapFromRESP() .convertFromRESPValue()
} }
/// Removes elements from a set. /// Removes elements from a set.
...@@ -83,7 +83,7 @@ extension RedisClient { ...@@ -83,7 +83,7 @@ extension RedisClient {
guard elements.count > 0 else { return self.eventLoop.makeSucceededFuture(0) } guard elements.count > 0 else { return self.eventLoop.makeSucceededFuture(0) }
return send(command: "SREM", with: [key] + elements) return send(command: "SREM", with: [key] + elements)
.mapFromRESP() .convertFromRESPValue()
} }
/// Randomly selects and removes one or more elements in a set. /// Randomly selects and removes one or more elements in a set.
...@@ -100,7 +100,7 @@ extension RedisClient { ...@@ -100,7 +100,7 @@ extension RedisClient {
guard count > 0 else { return self.eventLoop.makeSucceededFuture([]) } guard count > 0 else { return self.eventLoop.makeSucceededFuture([]) }
return send(command: "SPOP", with: [key, count]) return send(command: "SPOP", with: [key, count])
.mapFromRESP() .convertFromRESPValue()
} }
/// Randomly selects one or more elements in a set. /// Randomly selects one or more elements in a set.
...@@ -119,7 +119,7 @@ extension RedisClient { ...@@ -119,7 +119,7 @@ extension RedisClient {
guard count != 0 else { return self.eventLoop.makeSucceededFuture([]) } guard count != 0 else { return self.eventLoop.makeSucceededFuture([]) }
return send(command: "SRANDMEMBER", with: [key, count]) return send(command: "SRANDMEMBER", with: [key, count])
.mapFromRESP() .convertFromRESPValue()
} }
/// Moves an element from one set to another. /// Moves an element from one set to another.
...@@ -139,7 +139,7 @@ extension RedisClient { ...@@ -139,7 +139,7 @@ extension RedisClient {
guard sourceKey != destKey else { return self.eventLoop.makeSucceededFuture(true) } guard sourceKey != destKey else { return self.eventLoop.makeSucceededFuture(true) }
return send(command: "SMOVE", with: [sourceKey, destKey, element]) return send(command: "SMOVE", with: [sourceKey, destKey, element])
.mapFromRESP() .convertFromRESPValue()
.map { return $0 == 1 } .map { return $0 == 1 }
} }
...@@ -176,7 +176,7 @@ extension RedisClient { ...@@ -176,7 +176,7 @@ extension RedisClient {
guard keys.count > 0 else { return self.eventLoop.makeSucceededFuture([]) } guard keys.count > 0 else { return self.eventLoop.makeSucceededFuture([]) }
return send(command: "SDIFF", with: keys) return send(command: "SDIFF", with: keys)
.mapFromRESP() .convertFromRESPValue()
} }
/// Calculates the difference between two or more sets and stores the result. /// Calculates the difference between two or more sets and stores the result.
...@@ -192,7 +192,7 @@ extension RedisClient { ...@@ -192,7 +192,7 @@ extension RedisClient {
assert(keys.count > 0, "At least 1 key should be provided.") assert(keys.count > 0, "At least 1 key should be provided.")
return send(command: "SDIFFSTORE", with: [destination] + keys) return send(command: "SDIFFSTORE", with: [destination] + keys)
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -209,7 +209,7 @@ extension RedisClient { ...@@ -209,7 +209,7 @@ extension RedisClient {
guard keys.count > 0 else { return self.eventLoop.makeSucceededFuture([]) } guard keys.count > 0 else { return self.eventLoop.makeSucceededFuture([]) }
return send(command: "SINTER", with: keys) return send(command: "SINTER", with: keys)
.mapFromRESP() .convertFromRESPValue()
} }
/// Calculates the intersetion of two or more sets and stores the result. /// Calculates the intersetion of two or more sets and stores the result.
...@@ -225,7 +225,7 @@ extension RedisClient { ...@@ -225,7 +225,7 @@ extension RedisClient {
assert(keys.count > 0, "At least 1 key should be provided.") assert(keys.count > 0, "At least 1 key should be provided.")
return send(command: "SINTERSTORE", with: [destination] + keys) return send(command: "SINTERSTORE", with: [destination] + keys)
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -242,7 +242,7 @@ extension RedisClient { ...@@ -242,7 +242,7 @@ extension RedisClient {
guard keys.count > 0 else { return self.eventLoop.makeSucceededFuture([]) } guard keys.count > 0 else { return self.eventLoop.makeSucceededFuture([]) }
return send(command: "SUNION", with: keys) return send(command: "SUNION", with: keys)
.mapFromRESP() .convertFromRESPValue()
} }
/// Calculates the union of two or more sets and stores the result. /// Calculates the union of two or more sets and stores the result.
...@@ -258,6 +258,6 @@ extension RedisClient { ...@@ -258,6 +258,6 @@ extension RedisClient {
assert(keys.count > 0, "At least 1 key should be provided.") assert(keys.count > 0, "At least 1 key should be provided.")
return send(command: "SUNIONSTORE", with: [destination] + keys) return send(command: "SUNIONSTORE", with: [destination] + keys)
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -83,7 +83,7 @@ extension RedisClient { ...@@ -83,7 +83,7 @@ extension RedisClient {
} }
return send(command: "ZADD", with: args) return send(command: "ZADD", with: args)
.mapFromRESP() .convertFromRESPValue()
} }
/// Adds an element to a sorted set, assigning their score to the value provided. /// Adds an element to a sorted set, assigning their score to the value provided.
...@@ -112,7 +112,7 @@ extension RedisClient { ...@@ -112,7 +112,7 @@ extension RedisClient {
@inlinable @inlinable
public func zcard(of key: String) -> EventLoopFuture<Int> { public func zcard(of key: String) -> EventLoopFuture<Int> {
return send(command: "ZCARD", with: [key]) return send(command: "ZCARD", with: [key])
.mapFromRESP() .convertFromRESPValue()
} }
/// Gets the score of the specified element in a stored set. /// Gets the score of the specified element in a stored set.
...@@ -167,7 +167,7 @@ extension RedisClient { ...@@ -167,7 +167,7 @@ extension RedisClient {
@inlinable @inlinable
public func zrank(of element: RESPValueConvertible, in key: String) -> EventLoopFuture<Int?> { public func zrank(of element: RESPValueConvertible, in key: String) -> EventLoopFuture<Int?> {
return send(command: "ZRANK", with: [key, element]) return send(command: "ZRANK", with: [key, element])
.mapFromRESP() .convertFromRESPValue()
} }
/// Returns the rank (index) of the specified element in a sorted set. /// Returns the rank (index) of the specified element in a sorted set.
...@@ -182,7 +182,7 @@ extension RedisClient { ...@@ -182,7 +182,7 @@ extension RedisClient {
@inlinable @inlinable
public func zrevrank(of element: RESPValueConvertible, in key: String) -> EventLoopFuture<Int?> { public func zrevrank(of element: RESPValueConvertible, in key: String) -> EventLoopFuture<Int?> {
return send(command: "ZREVRANK", with: [key, element]) return send(command: "ZREVRANK", with: [key, element])
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -202,7 +202,7 @@ extension RedisClient { ...@@ -202,7 +202,7 @@ extension RedisClient {
within range: (min: String, max: String) within range: (min: String, max: String)
) -> EventLoopFuture<Int> { ) -> EventLoopFuture<Int> {
return send(command: "ZCOUNT", with: [key, range.min, range.max]) return send(command: "ZCOUNT", with: [key, range.min, range.max])
.mapFromRESP() .convertFromRESPValue()
} }
/// Returns the number of elements in a sorted set whose lexiographical values are between the range specified. /// Returns the number of elements in a sorted set whose lexiographical values are between the range specified.
...@@ -219,7 +219,7 @@ extension RedisClient { ...@@ -219,7 +219,7 @@ extension RedisClient {
within range: (min: String, max: String) within range: (min: String, max: String)
) -> EventLoopFuture<Int> { ) -> EventLoopFuture<Int> {
return send(command: "ZLEXCOUNT", with: [key, range.min, range.max]) return send(command: "ZLEXCOUNT", with: [key, range.min, range.max])
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -287,7 +287,7 @@ extension RedisClient { ...@@ -287,7 +287,7 @@ extension RedisClient {
} }
return send(command: command, with: args) return send(command: command, with: args)
.mapFromRESP(to: [RESPValue].self) .convertFromRESPValue(to: [RESPValue].self)
.flatMapThrowing { return try Self._mapSortedSetResponse($0, scoreIsFirst: true) } .flatMapThrowing { return try Self._mapSortedSetResponse($0, scoreIsFirst: true) }
} }
} }
...@@ -453,7 +453,7 @@ extension RedisClient { ...@@ -453,7 +453,7 @@ extension RedisClient {
in key: String in key: String
) -> EventLoopFuture<Double> { ) -> EventLoopFuture<Double> {
return send(command: "ZINCRBY", with: [key, amount, element]) return send(command: "ZINCRBY", with: [key, amount, element])
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -528,7 +528,7 @@ extension RedisClient { ...@@ -528,7 +528,7 @@ extension RedisClient {
} }
return send(command: command, with: args) return send(command: command, with: args)
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -588,7 +588,7 @@ extension RedisClient { ...@@ -588,7 +588,7 @@ extension RedisClient {
if withScores { args.append("WITHSCORES") } if withScores { args.append("WITHSCORES") }
return send(command: command, with: args) return send(command: command, with: args)
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -657,7 +657,7 @@ extension RedisClient { ...@@ -657,7 +657,7 @@ extension RedisClient {
} }
return send(command: command, with: args) return send(command: command, with: args)
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -721,7 +721,7 @@ extension RedisClient { ...@@ -721,7 +721,7 @@ extension RedisClient {
} }
return send(command: command, with: args) return send(command: command, with: args)
.mapFromRESP() .convertFromRESPValue()
} }
} }
...@@ -740,7 +740,7 @@ extension RedisClient { ...@@ -740,7 +740,7 @@ extension RedisClient {
guard elements.count > 0 else { return self.eventLoop.makeSucceededFuture(0) } guard elements.count > 0 else { return self.eventLoop.makeSucceededFuture(0) }
return send(command: "ZREM", with: [key]<