async def get_tasks(loop): app = Alerter.create_web() server = loop.create_server(app.make_handler(), '127.0.0.1', WEB_PORT) tasks = [] tasks.append(server) tasks.append(Alerter.notification_loop(NOTIFICATION_QUEUE, subscribers)) tasks.extend(Alerter.get_tasks()) tasks = asyncio.gather(*tasks) await tasks