def Close(self, abort=False):
    """Closes the queue.

    This needs to be called from any process or thread putting items onto
    the queue.

    Args:
      abort (Optional[bool]): True if the close was issued on abort.
    """
    if abort:
      # Prevent join_thread() from blocking.
      self._queue.cancel_join_thread()

    self._queue.close()
    self._queue.join_thread()
Closes the queue.

    This needs to be called from any process or thread putting items onto
    the queue.

    Args:
      abort (Optional[bool]): True if the close was issued on abort.