code: def get_request_id(self):
          
          try:
              return self.request_ids.popleft()
          except IndexError:
              new_request_id = self.highest_request_id + 1
              # in_flight checks should guarantee this
              assert new_request_id <= self.max_request_id
              self.highest_request_id = new_request_id
              return self.highest_request_id
docs: This must be called while self.lock is held.