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