Jai P
04/27/2022, 6:29 PMwait_for
between the subflows? i'll drop a trivial example in the threadJai P
04/27/2022, 6:30 PM@task
def my_task():
...
@flow
def subflow_1():
my_task()
@flow
def subflow_2():
my_task()
@flow
def my_flow():
subflow_1()
subflow_2()
Jai P
04/27/2022, 6:31 PMmy_task
running twice (maybe its a time-intensive task) in parallelAnna Geller
from prefect.task_runners import SequentialTaskRunner
@flow(task_runner=SequentialTaskRunner())
Jai P
04/27/2022, 6:35 PM@task
def my_task():
...
@task
def my_task_2():
...
@flow
def subflow_1():
my_task()
my_task_2()
@flow
def subflow_2():
my_task()
my_task_2()
@flow
def my_flow():
subflow_1()
subflow_2()
and the hope would be that my_task()
runs once and retrieves from cache once, but then my_task_2()
can return to being run in parallelJai P
04/27/2022, 6:36 PMSequentialTaskRunner
on the task itself?Anna Geller
Jai P
04/27/2022, 8:43 PMJai P
04/27/2022, 8:44 PMAnna Geller