Message336013
> Well, if you want to unconditionally end tasks you shouldn't write coroutines that ignore CancelledErrors.
Well, of course. But code can have bugs, and maybe you didn't write the coroutine because it's from a library that you don't control. In that case, you should still be able to end the task. Also, maybe the coroutine doesn't have a bug but the cancellation is just taking longer than you have time for, so you want to end it early.
> So what are those real-world cases that can explain why asyncio should support this functionality?
The case I had in mind was the one I referenced above -- being able to distinguish a normal CancelledError from one where you had interrupt the cancellation (i.e. cancellation timing out). I would like the caller to be able to know when the latter are happening. |
|
| Date |
User |
Action |
Args |
| 2019-02-19 20:07:03 | chris.jerdonek | set | recipients:
+ chris.jerdonek, asvetlov, yselivanov, Ilya.Kulakov |
| 2019-02-19 20:07:03 | chris.jerdonek | set | messageid: <1550606823.5.0.00179606444249.issue32363@roundup.psfhosted.org> |
| 2019-02-19 20:07:03 | chris.jerdonek | link | issue32363 messages |
| 2019-02-19 20:07:03 | chris.jerdonek | create | |
|