def flush_queue(self):
        """Grab all the current records in the queue and send them."""
        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()
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 ( )
Grab all the current records in the queue and send them.