Repository navigation
Make system tasks live inside their own contextvars context. - #520
Conversation
Codecov Report
@@ Coverage Diff @@
## master #520 +/- ##
==========================================
+ Coverage 99.26% 99.27% +<.01%
==========================================
Files 89 89
Lines 10405 10485 +80
Branches 721 727 +6
==========================================
+ Hits 10329 10409 +80
Misses 58 58
Partials 18 18
Continue to review full report at Codecov.
|
|
In case you were curious, the weird yapf stuff is because yapf uses the presence of a trailing comma on the last item as a hint that you want vertical formatting. |
njsmith
left a comment
There was a problem hiding this comment.
Also we should add a note to the spawn_system_task docs, in the list of differences between system and regular tasks. Otherwise LGTM.
| @@ -0,0 +1 @@ | |||
| Make system tasks run in their own context defined at the ``trio.run`` call. No newline at end of file | |||
There was a problem hiding this comment.
How about:
Tasks created by :func:`~trio.hazmat.spawn_system_task` now no longer inherit the creator's :mod:`contextvars` context.
?
There was a problem hiding this comment.
I wasn't sure what to put for the note, so this sounds a lot better.
Closes #289.
Re-do of my previous PR, which was a bit too ambitious.