async def METHOD_NAME(app, flow: http.HTTPFlow):
    """
    Serves app on flow.
    """
    scope = make_scope(flow)
    done = asyncio.Event()
    received_body = False
    sent_response = False
    async def receive():
        nonlocal received_body
        if not received_body:
            received_body = True
            return {
                "type": "http.request",
                "body": flow.request.raw_content,
            }
        else:  # pragma: no cover
            # We really don't expect this to be called a second time, but what to do?
            # We just wait until the request is done before we continue here with sending a disconnect.
            await done.wait()
            return {"type": "http.disconnect"}
    async def send(event):
        if event["type"] == "http.response.start":
            flow.response = http.Response.make(
                event["status"], b"", event.get("headers", [])
            )
            flow.response.decode()
        elif event["type"] == "http.response.body":
            assert flow.response
            flow.response.content += event.get("body", b"")
            if not event.get("more_body", False):
                nonlocal sent_response
                sent_response = True
        else:
            raise AssertionError(f"Unexpected event: {event['type']}")
    try:
        await app(scope, receive, send)
        if not sent_response:
            raise RuntimeError(f"no response sent.")
    except Exception as e:
        logger.exception(f"Error in asgi app: {e}")
        flow.response = http.Response.make(500, b"ASGI Error.")
    finally:
        done.set()