python - Running aiohttp application as a coroutine -
i have asyncio app , want add simple rest api using aiohttp. far can see, can either create aiohttp app , run aiohttp.web.run_app on thread, or i'd have forget app , use lower level aiohttp.web.server api. there way can use aiohttp.web.application , run web application coroutine instead of using run_app?
just open source code aiohttp.web:run_app (https://github.com/aio-libs/aiohttp/blob/master/aiohttp/web.py#l413-l467) , see how it's implemented.
you same do't call blocking loop.run_forever().
Comments
Post a Comment