lib/redis.rb in redis-4.6.0 vs lib/redis.rb in redis-4.7.0
- old
+ new
@@ -35,11 +35,11 @@
end
end
end
def current
- deprecate!("`Redis.current=` is deprecated and will be removed in 5.0. (called from: #{caller(1, 1).first})")
+ deprecate!("`Redis.current` is deprecated and will be removed in 5.0. (called from: #{caller(1, 1).first})")
@current ||= Redis.new
end
def current=(redis)
deprecate!("`Redis.current=` is deprecated and will be removed in 5.0. (called from: #{caller(1, 1).first})")
@@ -72,10 +72,12 @@
# @option options [Boolean] :inherit_socket (false) Whether to use socket in forked process or not
# @option options [Array] :sentinels List of sentinels to contact
# @option options [Symbol] :role (:master) Role to fetch via Sentinel, either `:master` or `:slave`
# @option options [Array<String, Hash{Symbol => String, Integer}>] :cluster List of cluster nodes to contact
# @option options [Boolean] :replica Whether to use readonly replica nodes in Redis Cluster or not
+ # @option options [String] :fixed_hostname Specify a FQDN if cluster mode enabled and
+ # client has to connect nodes via single endpoint with SSL/TLS
# @option options [Class] :connector Class of custom connector
#
# @return [Redis] a new client instance
def initialize(options = {})
@options = options.dup
@@ -106,9 +108,13 @@
# Disconnect the client as quickly and silently as possible.
def close
@original_client.disconnect
end
alias disconnect! close
+
+ def with
+ yield self
+ end
# @deprecated Queues a command for pipelining.
#
# Commands in the queue are executed with the Redis#commit method.
#