Matic Pecovnik
04/03/2024, 11:59 AMMarvin
04/03/2024, 12:00 PMasyncio.gather
, allowing asynchronous subflows to execute concurrently.
For more information on composing flows and running them in parallel, you can refer to Prefect's documentation on composing flows.Matic Pecovnik
04/03/2024, 12:02 PMNate
04/03/2024, 2:40 PMIn [1]: from prefect import flow
In [2]: import asyncio
In [3]: @flow
...: async def work():
...: await asyncio.sleep(5)
...:
In [4]: @flow
...: async def parent():
...: await asyncio.gather(*[work() for _ in range(5)])