code: def shutdown(self, wait=True):
          
          self.scheduler_thread.stop()
          self.worker_message_handler_thread.stop()
  
          if wait:
              self.scheduler_thread.join()
              self.worker_message_handler_thread.join()
docs: Shut down the worker message handler and scheduler threads.
          Args:
              wait: If true, block until both threads have successfully shut down. If False, return immediately.
  
          Returns: None