def pop(size = 1, timeout: nil)
      raise ArgumentError, 'size must be positive' unless size.positive?

      if timeout.nil?
        return self.connection.rpop(@key) if size == 1
        return shift_pop_script(keys: @key, argv: [-size, -1, 1])
      else
        raise ArgumentError, 'timeout is only supported if size == 1' unless size == 1
        return self.connection.brpop(@key, timeout: timeout)&.last
      end
    end
def pop(size = 1, timeout: nil)
      raise ArgumentError, 'size must be positive' unless size.positive?

      if timeout.nil?
        return self.connection.rpop(@key) if size == 1
        return shift_pop_script(keys: @key, argv: [-size, -1, 1])
      else
        raise ArgumentError, 'timeout is only supported if size == 1' unless size == 1
        return self.connection.brpop(@key, timeout: timeout)&.last
      end
    end
Pops an item from the list, optionally blocking to wait until the list is non-empty
 @param [Integer] timeout the amount of time to wait in seconds; if 0, waits indefinitely
 @return [nil, String] nil if the list was empty, otherwise the item