class_docstr: This is a queue based run data processor that queues incoming batches and processes them using
  single worker thread.
docstr: Flush the async logging queue.
  
  Calling this method will flush the queue to ensure all the data are logged.
docstr_tok: ["Flush","the","async","logging","queue",".","Calling","this","method","will","flush","the","queue","to","ensure","all","the","data","are","logged","."]
code: def flush(self) -> None:
      """Flush the async logging queue.
  
      Calling this method will flush the queue to ensure all the data are logged.
      """
      # Stop the data processing thread.
      self._stop_data_logging_thread_event.set()
      # Waits till logging queue is drained.
      self._batch_logging_thread.join()
      self._batch_status_check_threadpool.shutdown(wait=True)
  
      # Restart the thread to listen to incoming data after flushing.
      self._stop_data_logging_thread_event.clear()
      self._set_up_logging_thread()
  
imports: import atexit
  import logging
  import threading
  from concurrent.futures import ThreadPoolExecutor
  from queue import Empty, Queue
  from mlflow.entities.metric import Metric
  from mlflow.entities.param import Param
  from mlflow.entities.run_tag import RunTag
  from mlflow.utils.async_logging.run_batch import RunBatch
  from mlflow.utils.async_logging.run_operations import RunOperations
label_desc: Use image node_id 3 for calling the AsyncLoggingQueue obj's underlying member method code with example usage: obj.flush() without return types