-
Since |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
It probably should; the problem is, what if My SOP is to use a shield with a two-second-or-whatever timeout. Large enough to complete such a handshake, but too small to trigger my "hit ^C a few more times, then suspend and |
Beta Was this translation helpful? Give feedback.
-
Trio's convention is that:
So if you're using this convention, you don't want to shield the call to |
Beta Was this translation helpful? Give feedback.
-
do you have an example of what this was? not yielding during cancellations also sounds wrong |
Beta Was this translation helpful? Give feedback.
-
Wouldn't you want the shielded cancel scope to be set up in the outside caller (the one calling await aclose())? Not sure how you'd be able to wrap that behavior nicely. When the outer await happens, that's a cancel point even if the called method doesn't actually await, if I understand correctly. And that outer await would need to be shielded for aclose() to run at all. |
Beta Was this translation helpful? Give feedback.
Trio's convention is that:
aclose
methods must always succeed, regardless of whether they're called in a cancelled context or notSo if you're using this convention, you don't want to shield the call to
aclose
, because that deniesaclose
the ability to tell whether it's supposed to do a graceful shutdown or not. It does require that everyone writingaclose
methods follows the rules, though.