Avatar
なるほど。
11:09 AM
そういう意味だと、 CancellationErrorはlightweightなキャンセル通知を意図したもので、キャンセル時にはCEを使うのがルール、ということはないと思います。 (edited)
11:10 AM
It is intentional that no information is passed to the task about why it was cancelled. A task may be cancelled for many reasons, and additional reasons may accrue / after the initial cancellation (for example, if the task fails to immediately exit, it may pass a deadline). The goal of cancellation is to allow tasks to be cancelled in a lightweight way, not to be a secondary method of inter-task communication.
(edited)