def popshift(list, timeout: nil)
      raise ArgumentError, 'list must respond to #key' unless list.respond_to?(:key)

      if timeout.nil?
        return self.connection.rpoplpush(@key, list.key)
      else
        return self.connection.brpoplpush(@key, list.key, timeout: timeout)
      end
    end
def popshift(list, timeout: nil)
      raise ArgumentError, 'list must respond to #key' unless list.respond_to?(:key)

      if timeout.nil?
        return self.connection.rpoplpush(@key, list.key)
      else
        return self.connection.brpoplpush(@key, list.key, timeout: timeout)
      end
    end
Pops an element from this list and shifts it onto the given list.
 @param [Redstruct::List] list the list to shift the element onto
 @param [#to_i] timeout optional timeout to wait for in seconds
 @return [String] the element that was popped from the list and pushed onto the other