question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

swap the stream contexts with the taskgroup context

See original GitHub issue
        with send_channel, receive_channel:
            async with anyio.create_task_group() as task_group:

might be better as

        async with anyio.create_task_group() as task_group:
            with send_channel, receive_channel:

this way closing the amap context manager (None, None, None)ly would allow currently running tasks to finish, and prevent new tasks being added. Closing the amap context manager (type[T], T, tb)ly would still cancel all tasks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
graingertcommented, Jul 5, 2021
0reactions
graingertcommented, Jul 7, 2021

also anyio 3 supports taskgroup.start so you can limit tasks with:

async def execute_task(semaphore, async_fn, \, *args, task_status, **kwargs):
    async with semaphore:
        task_status.started()
        await async_fn(*args, **kwargs)

async with anyio.create_task_group() as tg:
    for task in tasks:
        await tg.start(execute_task, task, semaphore)
Read more comments on GitHub >

github_iconTop Results From Across the Web

TaskGroup | Apple Developer Documentation
A group that contains dynamically created child tasks. iOS 13.0+ iPadOS 13.0+ macOS 10.15+ Mac Catalyst 13.0+ ...
Read more >
Airflow task groups | Astronomer Documentation
Follow Astronomer's step-by-step guide to use task groups for organizing tasks within the graph view of the Airflow user interface.
Read more >
Airflow TaskGroups: All you need to know! - Marc Lamberti
Airflow TaskGroups provide a way to group your tasks and make your DAGs cleaner. ... Context Manager; Dynamically Generating Task Groups; Task Group...
Read more >
Enhancing the Effectiveness of Work Groups and Teams
Team self-correction training focuses on skills relevant to (a) event review (following a task episode), (b) error identification, (c) feedback exchange, and (d) ......
Read more >
Report of the PCC Ad Hoc Task Group on Gender in Name ...
Background. On August 1, 2016 an ad hoc task group was formed to address concerns raised by the. Program for Cooperative Cataloging (PCC) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found