pgjones / hypercorn

Hypercorn is an ASGI and WSGI Server based on Hyper libraries and inspired by Gunicorn.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ASGIWrapper: make sync_spawn and call_soon optional

virajkanwade opened this issue · comments

sync_spawn: Callable,

Most asgi middlewares implement __call__ with only 3 params, scope, receive and send.

        sync_spawn: Callable,
        call_soon: Callable,

These are anyways not being used. So making them optional might make it simpler for integration.

        sync_spawn: Callable | None = None,
        call_soon: Callable | None = None,

ASGIWrapper is not meant to be used as middleware, you can use normal ASGI middleware with Hypercorn though by wrapping the app with it. Is there something about ASGIWrapper you specifically want to use?

@pgjones we were trying to integrate Hypercorn in appmap. getappmap/appmap-python#251 (comment)

But they decided to support only uvicorn. So you can close this if you want to.

Ok, for clarity ASGIWrapper is meant for Hypercorn's internal usage. The same ASGI middleware that works with Uvicorn will work with Hypercorn.