Proper way to shutdown asyncio tasks
The cancellation is not immediate and requires running ioloop to be resolved with exception CancelledError. Remove ioloop.stop from shutdown and handle exception in supervisor, to make things work. Below simplified example. Important is, however you can cancel Task, it only stops watching/waiting for end/results and loop won’t handle further events for it. But the underneath … Read more