def main(): logging.config.dictConfig(yaml.load(open("logging.yml").read())) loop = asyncio.get_event_loop() borg_config = BorgConfig(filename="borg.yml") one_for_one = SupervisorOneForOne(loop=loop) for name, bot_config in borg_config.bots.items(): one_for_one.add_child(name, make_bot_constructor(bot_config, loop)) loop.run_until_complete(one_for_one.task) logger.info("main() borg shutdown!") loop.run_until_complete(asyncio.wait(asyncio.Task.all_tasks(loop=loop))) # Let everything else shutdown cleanly