code: def shutdown(self):
          
          self.run_clean_thread = False
          self.cleanup(True)
          if self.cleaner_thread.isAlive():
              self.cleaner_thread.join()
docs: shutdown: to be run by atexit handler. All open connection are closed.