class_docstr: Writes bytes to a file.
docstr: Writes bytes to a file asynchronously. An instance of this class
  holds a queue to keep the incoming data temporarily. Data passed to the
  `write` function will be put to the queue and the function returns
  immediately. This class also maintains a thread to write data in the
  queue to disk. The first initialization parameter is an instance of
  `tensorboard.summary.record_writer` which computes the CRC checksum and
  then write the combined result to the disk. So we use an async approach
  to improve performance.
  
  Args:
      record_writer: A RecordWriter instance
      max_queue_size: Integer. Size of the queue for pending bytestrings.
      flush_secs: Number. How often, in seconds, to flush the
          pending bytestrings to disk.
docstr_tok: ["Writes","bytes","to","a","file","asynchronously",".","An","instance","of","this","class","holds","a","queue","to","keep","the","incoming","data","temporarily",".","Data","passed","to","the","`","write","`","function","will","be","put","to","the","queue","and","the","function","returns","immediately",".","This","class","also","maintains","a","thread","to","write","data","in","the","queue","to","disk",".","The","first","initialization","parameter","is","an","instance","of","`","tensorboard.summary.record_writer","`","which","computes","the","CRC","checksum","and","then","write","the","combined","result","to","the","disk",".","So","we","use","an","async","approach","to","improve","performance",".","Args",":","record_writer",":","A","RecordWriter","instance","max_queue_size",":","Integer",".","Size","of","the","queue","for","pending","bytestrings",".","flush_secs",":","Number",".","How","often",",","in","seconds",",","to","flush","the","pending","bytestrings","to","disk","."]
code: def __init__(self, record_writer, max_queue_size=20, flush_secs=120):
      """Writes bytes to a file asynchronously. An instance of this class
      holds a queue to keep the incoming data temporarily. Data passed to the
      `write` function will be put to the queue and the function returns
      immediately. This class also maintains a thread to write data in the
      queue to disk. The first initialization parameter is an instance of
      `tensorboard.summary.record_writer` which computes the CRC checksum and
      then write the combined result to the disk. So we use an async approach
      to improve performance.
  
      Args:
          record_writer: A RecordWriter instance
          max_queue_size: Integer. Size of the queue for pending bytestrings.
          flush_secs: Number. How often, in seconds, to flush the
              pending bytestrings to disk.
      """
      self._writer = record_writer
      self._closed = False
      self._byte_queue = queue.Queue(max_queue_size)
      self._worker = _AsyncWriterThread(
          self._byte_queue, self._writer, flush_secs
      )
      self._lock = threading.Lock()
      self._worker.start()
  
imports: import os
  import queue
  import socket
  import threading
  import time
  from tensorboard.compat import tf
  from tensorboard.compat.proto import event_pb2
  from tensorboard.summary.writer.record_writer import RecordWriter
label_desc: Use image node_id 1 to create a new _AsyncWriter object  with example: obj = _AsyncWriter(record_writer, max_queue_size, flush_secs)