async def notify_shutdown(self):
        """Notify the ASGI app that the server is shutting down."""
        if not self.lifespan_receive_queue or not self.lifespan_shutdown_event:
            raise RuntimeError("notify_startup() must be called first.")

        self._logger.debug("Notifying ASGI app of shutdown.")
        shutdown_event = {"type": "lifespan.shutdown"}
        await self.lifespan_receive_queue.put(shutdown_event)
        await self.lifespan_shutdown_event.wait()
Notify the ASGI app that the server is shutting down.
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/functions/_http_asgi.py