Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Aiohttp server Background task loop deprecated #3526
Long story short
In the docs there is an explanation on how to create a Background task (in this case, a Redis listener)
I want to create a background task to listen for Postgres notifications.
In the docs, the example is
When running the code, a warning occurs:
Steps to reproduce
Aiohttp server instance (version 3.5.3), Ubuntu 18.04
what should i use instead of
this is my case:
app = web.Application(loop=loop, middlewares=get_middlewares()) app.on_startup.append(load_plugins) # ... async def load_plugins(app): app.mongo = Mongo.create() app.mongo.initialize(app.loop) app.redis = await get_cache(loop=app.loop)
In this case is better to wait for an update of
@rafa-acioly I believe the idea is to still use the loop if a third party library requires it but it's instead of referencing app.loop, just use what you get from get_running_loop().