aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/uvicorn/middleware/asgi2.py
blob: 75145f73227f9acae2a4598495c9a8b741fa89f1 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from uvicorn._types import (
    ASGI2Application,
    ASGIReceiveCallable,
    ASGISendCallable,
    Scope,
)


class ASGI2Middleware:
    def __init__(self, app: "ASGI2Application"):
        self.app = app

    async def __call__(
        self, scope: "Scope", receive: "ASGIReceiveCallable", send: "ASGISendCallable"
    ) -> None:
        instance = self.app(scope)
        await instance(receive, send)