Skip to content

ASGI applications and aliases

These aliases in h2corn.types describe the callable boundary between an ASGI application and h2corn. Application accepts either the precise ASGIApp contract or the broader mutable-mapping annotations used by framework applications.

ASGIAppmodule-attribute

ASGIApp = Callable[[Scope, Receive, Send], Awaitable[None]]

FrameworkASGIAppmodule-attribute

FrameworkASGIApp = Callable[
    [MutableMapping[str, Any], FrameworkReceive, FrameworkSend], Awaitable[None]
]

Applicationmodule-attribute

Application = ASGIApp | FrameworkASGIApp

ApplicationFactorymodule-attribute

ApplicationFactory = Callable[[], Application]

Receivemodule-attribute

Receive = Callable[[], Awaitable[ReceiveMessage]]

Sendmodule-attribute

Send = Callable[[SendMessage], Awaitable[None]]

Scopemodule-attribute

Messagemodule-attribute