@classmethod
def shutdown_async_executor(cls, wait=True):
    """Shuts down the executor cleanly."""
    if cls._async_executor:
        executor = cls._async_executor
        cls._async_executor = None
        executor.shutdown(wait)
