code: def start_listener_thread(self, timeout_ms=30000, exception_handler=None):
          
          try:
              thread = Thread(target=self.listen_forever,
                              args=(timeout_ms, exception_handler))
              thread.daemon = True
              self.sync_thread = thread
              self.should_listen = True
              thread.start()
          except RuntimeError:
              e = sys.exc_info()[0]
              logger.error("Error: unable to start thread. %s", str(e))
docs: Start a listener thread to listen for events in the background.
  
          Args:
              timeout (int): How long to poll the Home Server for before
                 retrying.
              exception_handler (func(exception)): Optional exception handler
                 function which can be used to handle exceptions in the caller
                 thread.