code: def stop_sync(self):
          
  
          conn_ids = self.conns.get_connections()
  
          # If we have any open connections, try to close them here before shutting down
          for conn in list(conn_ids):
              try:
                  self.disconnect_sync(conn)
              except HardwareError:
                  pass
  
          self.client.disconnect()
          self.conns.stop()
docs: Synchronously stop this adapter