backport of asyncio.TaskGroup, asyncio.Runner and asyncio.timeout
Low maintenance activity. Last release 23 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases. It brings a standard-library module to older Pythons: on current versions, use the built-in one.
pip install taskgrouptaskgroup
a backport of asyncio.TaskGroup, asyncio.Runner and asyncio.timeout
background
This is a backport of the TaskGroup, Runner and timeout code from Python 3.12.8 to Python 3.8, Python 3.9, Python 3.10 and Python 3.11.
operation
This project works by temporarily swapping the current task of a coroutine to a subclass of asyncio.Task with uncancel and context setting support. The advantage of this approach means that most of the operation of asyncio.Task will continue to be c-accelerated.
example
if sys.python_version >= (3, 11):
from asyncio import run, TaskGroup, timeout
else:
from taskgroup import run, TaskGroup, timeout
async def main():
async with TaskGroup() as group:
group.create_task(task1())
group.create_task(task2())
run(main())
changelog
0.2.2
What's Changed
- update note about which version we backported from by @graingert in https://github.com/graingert/taskgroup/pull/27
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/graingert/taskgroup/pull/28
- restore support for 3.8 by @graingert in https://github.com/graingert/taskgroup/pull/30
New Contributors
- @pre-commit-ci made their first contribution in https://github.com/graingert/taskgroup/pull/28
Full Changelog: https://github.com/graingert/taskgroup/compare/0.2.1...0.2.2
0.2.1
What's Changed
- make _Interceptor not abstract by @graingert in https://github.com/graingert/taskgroup/pull/25
Full Changelog: https://github.com/graingert/taskgroup/compare/0.2.0...0.2.1