- Notifications
You must be signed in to change notification settings - Fork1k
Open
Description
Hi Luciano,
I am playing a bit with thespinner_async.py
example, and I am wondering why the execution finishes normally when I comment thespinner.cancel()
line in thesupervisor
function. I think the execution should stay in an infinite loop because I am not cancelling the coroutine and, therefore theasyncio.CancelledError
exception is never raised.
asyncdefsupervisor()->int:# <3>spinner=asyncio.create_task(spin('thinking!'))# <4>print(f'spinner object:{spinner}')# <5>result=awaitslow()# <6>#spinner.cancel() # <------This is the only change <7>returnresult
I am forgetting something?, any comments to help me to understand this scenario are welcome.
Metadata
Metadata
Assignees
Labels
No labels