def client_for(method)
      stack = Thread.current[@current_client_key] ||= []
      client = if stack.last
        stack.last
      elsif @master_only
        master
      elsif REDIS_READ_OPS.include?(method)
        slave
      else
        master
      end

      stack << client
      client
    end
def client_for(method)
      stack = Thread.current[@current_client_key] ||= []
      client = if stack.last
        stack.last
      elsif @master_only
        master
      elsif REDIS_READ_OPS.include?(method)
        slave
      else
        master
      end

      stack << client
      client
    end
Acquires a client to use for the specified operation.

 @param [Symbol] method the method for which to retrieve a client
 @return [Redis] a redis client to use
 @note
   This method stores a stack of clients used to handle the case
   where the same RedisFailover::Client instance is referenced by
   nested blocks (e.g., block passed to multi).