From d145c3f98bbf19d3f18c80b6c10f80c4cf7f0339 Mon Sep 17 00:00:00 2001 From: Goran Cetusic Date: Sat, 12 Jan 2019 16:40:18 +0100 Subject: [PATCH 1/3] misc docs fix - background tasks example throws a deprecation warning --- docs/web_advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/web_advanced.rst b/docs/web_advanced.rst index a2d17443d20..cb675c40f64 100644 --- a/docs/web_advanced.rst +++ b/docs/web_advanced.rst @@ -956,7 +956,7 @@ signal handlers as shown in the example below:: async def start_background_tasks(app): - app['redis_listener'] = app.loop.create_task(listen_to_redis(app)) + app['redis_listener'] = asyncio.create_task(listen_to_redis(app)) async def cleanup_background_tasks(app): From a3168f1e0e23df9f2fdd5a0e5246a4775689dbf6 Mon Sep 17 00:00:00 2001 From: Goran Cetusic Date: Sat, 12 Jan 2019 16:59:56 +0100 Subject: [PATCH 2/3] misc fix - loop not needed for aioredis, uses get_event_loop by default --- docs/web_advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/web_advanced.rst b/docs/web_advanced.rst index cb675c40f64..65cc7e69125 100644 --- a/docs/web_advanced.rst +++ b/docs/web_advanced.rst @@ -942,7 +942,7 @@ signal handlers as shown in the example below:: async def listen_to_redis(app): try: - sub = await aioredis.create_redis(('localhost', 6379), loop=app.loop) + sub = await aioredis.create_redis(('localhost', 6379)) ch, *_ = await sub.subscribe('news') async for msg in ch.iter(encoding='utf-8'): # Forward message to all connected websockets: From bb39f1905540eae6cffc69d787fa7eda3fc78010 Mon Sep 17 00:00:00 2001 From: Goran Cetusic Date: Sat, 12 Jan 2019 18:31:37 +0100 Subject: [PATCH 3/3] added doc changelog for issue #3526 --- CHANGES/3526.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGES/3526.doc diff --git a/CHANGES/3526.doc b/CHANGES/3526.doc new file mode 100644 index 00000000000..b5edd928bc3 --- /dev/null +++ b/CHANGES/3526.doc @@ -0,0 +1 @@ +Modify documentation for Background Tasks to remove deprecated usage of event loop.