code: def run(self):
      has_unresolved_bug = False
      while True:
          now = time.time()
          queue_wait_duration = self._next_flush_time - now
          data = None
          try:
              if queue_wait_duration > 0:
                  data = self._queue.get(True, queue_wait_duration)
              else:
                  data = self._queue.get(False)
  
              if data == self._shutdown_signal:
                  return
  
              self._record_writer.write(data)
              self._has_pending_data = True
          except queue.Empty:
              pass
          except Exception as e:
              # prevent the main thread from deadlock due to writing error.
              if not has_unresolved_bug:
                  print(
                      "Warning: Writing data Error, Due to unresolved Exception {}".format(
                          e
                      )
                  )
                  print(
                      "Warning: Writing data to FileSystem failed since {}.".format(
                          time.strftime(
                              "%a, %d %b %Y %H:%M:%S +0000",
                              time.gmtime(),
                          )
                      )
                  )
              has_unresolved_bug = True
              pass
          finally:
              if data:
                  self._queue.task_done()
  
          now = time.time()
          if now > self._next_flush_time:
              if self._has_pending_data:
                  self._record_writer.flush()
                  self._has_pending_data = False
              self._next_flush_time = now + self._flush_secs
  
imports: from visualdl.io import bfile
  from visualdl.utils.crc32 import masked_crc32c
  from visualdl.proto import record_pb2
  import struct
  import time
  import queue
  import threading
  import os
label_desc: Use image node_id 3 for calling the _AsyncWriterThread obj's underlying member method code with example usage: obj.run() without return types