https://prefect.io logo
Title
t

Tony Yun

08/19/2022, 3:37 PM
how to stop the async task runs in flow context? I need to execute a loop in the flow context but I don’t want it to execute the next loop before the first loop is finished. I see the tasks are executed asynchrously. For example:
with Flow(
    name="ETL",
) as flow:
    page = 0
    max_page = 999999
    while page <= max_page:
        page += 1
        dummy_task()
I read this in the prefect 2 doc but it seems it’s not available in 1:
Sequential execution
task runner:
from prefect.task_runners import SequentialTaskRunner
m

Mason Menges

08/19/2022, 6:23 PM
Hey @Tony Yun in 1.0 this would be the LocalExecutor
from prefect.executors import LocalExecutor

flow.executor = LocalExecutor()
from this article https://discourse.prefect.io/t/what-is-the-default-taskrunner-executor/63