Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Sketch of how shared tasks might work #303

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

njsmith
Copy link
Member

@njsmith njsmith commented Aug 21, 2017

See gh-266

This is surprisingly interesting and tricky.

See python-triogh-266

This is surprisingly interesting and tricky.
@codecov
Copy link

codecov bot commented Aug 22, 2017

Codecov Report

Attention: Patch coverage is 0% with 76 lines in your changes missing coverage. Please review.

Project coverage is 99.58999%. Comparing base (5ca9662) to head (d5327ca).

Files with missing lines Patch % Lines
src/trio/_shared_task.py 0.00000% 76 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##                 main        #303         +/-   ##
====================================================
- Coverage   100.00000%   99.58999%   -0.41001%     
====================================================
  Files             124         125          +1     
  Lines           18460       18536         +76     
  Branches         1216        1224          +8     
====================================================
  Hits            18460       18460                 
- Misses              0          76         +76     
Files with missing lines Coverage Δ
src/trio/_shared_task.py 0.00000% <0.00000%> (ø)

@njsmith
Copy link
Member Author

njsmith commented Sep 2, 2018

One issue with this as currently written is that it uses outcome.unwrap() multiple times, which of course doesn't work.

We could mess around somehow trying to copy exceptions, but maybe it's better to do something simpler: if there's an error in a shared task, do raise SharedTaskError from <actual exception>. It's fine for multiple exceptions to have __cause__ pointing to the same object, because __cause__ doesn't get mutated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants