hypercorn
hypercorn copied to clipboard
ASGIWrapper: make sync_spawn and call_soon optional
https://github.com/pgjones/hypercorn/blob/3fbd5f245e5dfeaba6ad852d9135d6a32b228d05/src/hypercorn/app_wrappers.py#L31
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,
@pgjones thoughts? Thanks
https://github.com/getappmap/appmap-python/issues/251#issuecomment-1936750685
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. https://github.com/getappmap/appmap-python/issues/251#issuecomment-1936750685
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.