Exemple #1
0
 def shutdown(self):
     """Handle any client shutdown cleanup."""
     # Ensure all threads are cleaned and conversations are handled
     try:
         self.is_running = False
         self._expire_all_conversations()
     except BaseException:
         pass
     finally:
         server_utils.delete_server(self.server_task_name)
Exemple #2
0
 def shutdown(self):
     """Handle any client shutdown cleanup."""
     # Ensure all threads are cleaned and conversations are handled
     try:
         self.is_running = False
         self._expire_all_conversations()
     except BaseException:
         pass
     finally:
         server_utils.delete_server(self.server_task_name)
Exemple #3
0
 def shutdown(self):
     """Handle any client shutdown cleanup."""
     # Ensure all threads are cleaned and conversations are handled
     try:
         self.is_running = False
         if not self.bypass_server_setup:
             self.message_socket.keep_running = False
         self._expire_all_conversations()
     except BaseException:
         pass
     finally:
         if not self.bypass_server_setup:
             server_utils.delete_server(self.server_task_name,
                                        self.opt['local'])
Exemple #4
0
    def shutdown(self):
        """Handle any client shutdown cleanup."""
        # Ensure all threads are cleaned and conversations are handled
        try:
            self.is_running = False
            self.world_runner.shutdown()
            if not self.bypass_server_setup:
                self.message_socket.keep_running = False
            self._expire_all_conversations()
        except BaseException as e:
            shared_utils.print_and_log(logging.ERROR,
                                       f'world ended in error: {e}')

        finally:
            if not self.bypass_server_setup:
                server_utils.delete_server(self.server_task_name,
                                           self.opt['local'])