(This is a follow-up question to this one.)
The docs for asyncio say:
If a Future.set_exception() is called but the Future object is never awaited on, the exception would never be propagated to the user code. In this case, asyncio would emit a log message when the Future object is garbage collected.
I want to know whether there's any way to make python forcefully log exceptions regardless of :
- Whether or not I awaited the task
- Whether or not the task is garbage collected
Basically, I want the ability to fire and forget some background tasks from anywhere in my code, and not worry about await
-ing them all the time.
My first-hand async experience was in dart, which does not seem to suffer from this issue.
(Plus, this blatantly violates the zen of python #10).