achimnol / aiotools

Idiomatic asyncio utilties
https://aiotools.readthedocs.io
MIT License
154 stars 12 forks source link

refactor: Introduce TaskScope and TaskContext #58

Open achimnol opened 1 year ago

achimnol commented 1 year ago

This PR adds TaskContext and TaskScope to reuse the core concepts and logics for structured concurrency in Supervisor and other coroutine aggregation utilities like as_completed_safe(), gather_safe(), and race().

codecov[bot] commented 1 year ago

Codecov Report

Attention: Patch coverage is 71.80617% with 64 lines in your changes missing coverage. Please review.

Project coverage is 74.00%. Comparing base (75ac9e3) to head (5647a22). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/aiotools/taskcontext.py 55.43% 41 Missing :warning:
src/aiotools/taskscope.py 87.38% 14 Missing :warning:
src/aiotools/utils.py 35.71% 9 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #58 +/- ## ========================================== - Coverage 74.78% 74.00% -0.79% ========================================== Files 18 20 +2 Lines 1138 1250 +112 ========================================== + Hits 851 925 +74 - Misses 287 325 +38 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.