code: def flush_queue(self):
          
          records = []
  
          while not self.queue.empty() and len(records) < self.batch_size:
              records.append(self.queue.get())
  
          if records:
              self.send_records(records)
              self.last_flush = time.time()
docs: Grab all the current records in the queue and send them.