Skip to content

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

Open
njsmith wants to merge 5 commits intopython-trio:mainfrom
njsmith:shared-tasks
Open

[wip] Sketch of how shared tasks might work#303
njsmith wants to merge 5 commits intopython-trio:mainfrom
njsmith:shared-tasks

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

❌ 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).
⚠️ Report is 432 commits behind head on main.

Files with missing lines Patch % Lines
src/trio/_shared_task.py 0.00000% 76 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00000%) is below the target coverage (100.00000%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (99.58999%) is below the target coverage (100.00000%). You can increase the head coverage or adjust the target coverage.

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%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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.

2 participants