lib/redis.rb in redis-3.3.1 vs lib/redis.rb in redis-3.3.2
- old
+ new
@@ -1334,16 +1334,21 @@
end
end
end
end
- # Remove and return a random member from a set.
+ # Remove and return one or more random member from a set.
#
# @param [String] key
# @return [String]
- def spop(key)
+ # @param [Fixnum] count
+ def spop(key, count = nil)
synchronize do |client|
- client.call([:spop, key])
+ if count.nil?
+ client.call([:spop, key])
+ else
+ client.call([:spop, key, count])
+ end
end
end
# Get one or more random members from a set.
#