tractor
tractor copied to clipboard
idea: an `ActorCancelled(ContextCancelled)` exc type for better OoB cancelled handling
Per recent testing effort, issue-docs drafting and generally ranting in the trio matrix room 🫣 here is the recent content driving this idea,
- #399 starts dedicated testing around such scenarios
- #400 attempts to justify the need for more then just
trio.Cancelled - #391 demos why
trio.Cancelledand so called "exception masking" can be problematic in a distributed system where error/cancel relay is important for distributed-sys feats.
New supporting feats in trio we should try here
With release 0.31.0 we get a new Cancelled.reason: str which can be set at the .cancel(reason) call,
- introducing patch, https://github.com/python-trio/trio/issues/3232
- docs on
CancelScope.cancel() - low level impl details,
- internal
CancelReasonstruct - which is now a private instance var on all scopes.
- how and where it's set in `._cancel()
- example low-level-internal usage in case we wanted to overload the type in
._child_finished()
- internal