Mailing List Archive

Re: Running asyncio.run() more than once
Le mardi 14 mars 2023 à 02:32:23 UTC-4, Clint Olsen a écrit :
> We have an application that involves submitting hundreds to thousands of jobs to a shared computing resource, and we're using asyncio to do so because it is far less overhead than threading or multiprocessing for the bookkeeping required to keep track of all these jobs. It makes extensive use of asyncio.create_subprocess_exec(). This was developed mostly in Python 3.9.7.
>

I'm not asyncio expert or even not advanced user, but using a simple list to hold the jobs to execute and fill it as necessary after results gathering is not good ?

```
@async
def execute_jobs(jobs: List["Job"]):
while len(jobs) > 0:
# launch_job(s)
# gather_job(s)_result(s)
# append_jobs_if_desired
```

does not make the trick ?

--
https://mail.python.org/mailman/listinfo/python-list