fetchai/uAgents

Consolidate ASGI send methods

Closed this issue · 0 comments

The goal is to reduce maintenance overhead and improve overall code stability by consolidating the individual send methods of the asgi.py module into a separate function.

e.g.

async def send_response(...):
    await send(
        {
            "type": "http.response.start",
            "status": <status>,
            "headers": <headers>,
        }
    )
    await send(
        {
            "type": "http.response.body",
            "body": <body>,
        }
    )
    return