Avatar
Good day everyone, Making use of the week where development branches are locked, I’d like to pre-flight a pitch which is a follow-up to the async deinit we’ve done recently as part of SE-0493: Support async calls in defer bodies: task cancellation shields. In that proposal’s review there was a discussion about “shielding” pieces of c...
10:06 AM
タスクキャンセルシールドというややこしいやつ
😵‍💫 4
10:06 AM
キャンセルされてdeferでクリーンアップ処理をやるとして、
10:07 AM
そのクリーンアップ処理の中でAPI呼び出しみたいな非同期処理をしたい場合に
10:08 AM
そのためのAPI Clientやらが、キャンセル状態を検出して何もしないで例外を投げてしまう、という問題がある
10:08 AM
ので、キャンセル状況下であっても、指定したスコープ内ではやっぱりキャンセルされてないことにする、機能。
👀 1
10:10 AM
なお、そのシールドの中でまた別途キャンセルが起きる可能性があり、その場合はキャンセル状態になる。つまりシールドされた領域は入れ子になりうる。