How to use context.run(asynchronous=True) for many tasks
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
Start with the Promise.join API documentation linked in the issue and the context.run(asynchronous=True) entry point. Clarify how several asynchronous runs can be waited on together, including completion and error behavior, and add a concise usage example so the documentation answers the five-task scenario.
Written by the indexing model from the issue text.
Description
Hi, a usage question as the docs are quite lite on this topic.
If I want to make 5 context.run() calls concurrently but I don't want to complete execution of my function until they have all finished, is there something more elegant than this:
class AggregateError(Exception):
pass
running = [context.run(foo, async=True), context.run(bar, async=True), context.run(baz, async=True)]
while running:
for promise, index in enumerate(running[:]):
....
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 412
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pyinvoke/invoke
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100