def disconnect_handler(self, client_closed: bool=False) -> None: if self.current_handler_id: clear_descriptor_by_handler_id(self.current_handler_id, None) clear_handler_by_id(self.current_handler_id) if client_closed: logging.info("Client disconnected for queue %s (%s via %s)" % (self.event_queue.id, self.user_profile_email, self.current_client_name)) self.current_handler_id = None self.current_client_name = None if self._timeout_handle is not None: ioloop = tornado.ioloop.IOLoop.instance() ioloop.remove_timeout(self._timeout_handle) self._timeout_handle = None