def get_request_id(self):
        """
        This must be called while self.lock is held.
        """
        try:
            return self.request_ids.popleft()
        except __HOLE__:
            self.highest_request_id += 1
            # in_flight checks should guarantee this
            assert self.highest_request_id <= self.max_request_id
            return self.highest_request_id
dataset/ETHPy150Open datastax/python-driver/cassandra/connection.py/Connection.get_request_id