class_docstr: Writes bytes to a file.
docstr: Enqueue the given bytes to be written asychronously.
docstr_tok: ["Enqueue","the","given","bytes","to","be","written","asychronously","."]
code: def write(self, bytestring):
      """Enqueue the given bytes to be written asychronously."""
      with self._lock:
          # Status of the worker should be checked under the lock to avoid
          # multiple threads passing the check and then switching just before
          # blocking on putting to the queue which might result in a deadlock.
          self._check_worker_status()
          if self._closed:
              raise IOError("Writer is closed")
          self._byte_queue.put(bytestring)
          # Check the status again in case the background worker thread has
          # failed in the meantime to avoid waiting until the next call to
          # surface the error.
          self._check_worker_status()
  
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 2 for calling the _AsyncWriter obj's underlying member method code with example usage: obj.write(bytestring) without return types