KG
01/11/2024, 5:07 PMMarvin
01/11/2024, 5:07 PMasync/await
syntax. Asynchronous execution does not necessarily equate to parallel execution; it can run tasks concurrently in a single thread by interleaving their execution.
3. If you use the asyncio
library without specific parallel execution settings (like asyncio.gather
), your tasks are unlikely to run in parallel. For asynchronous execution using the ConcurrentTaskRunner
, you must call .submit()
for tasks unless you're employing asyncio.gather
which handles submission.
4. There might also be concurrency limits set up, which prevent too many tasks from running simultaneously. This limit could be defined to avoid overloading resources such as database connections.
Parallel execution of tasks typically requires a setup to be in place, such as using a multi-processing approach or cluster computing solutions where multiple processes can be run on different CPU cores, or even on different machines.
If you need more specific details on parallel execution in Prefect 2.x, which you mentioned is new to you, please let me know and I could further investigate, probably with a less-than-enthusiastic attitude given my programming for such mundane tasks.Nate
01/11/2024, 5:08 PMNate
01/11/2024, 5:08 PMKG
01/11/2024, 5:08 PMKG
01/11/2024, 5:09 PMNate
01/11/2024, 5:11 PMMarvin
01/11/2024, 5:11 PMNate
01/11/2024, 5:12 PMMarvin
01/11/2024, 5:12 PMKG
01/11/2024, 5:12 PM