code: def close(self):
          
          if self._closed:
              return
          self._closed = True
          self.queue("close", None)
          if not self._flushed.wait(timeout=self._max_flush_time):
              raise ValueError("close timed out")
docs: Cleans up resources and closes connection
          :return: