https://prefect.io logo
#prefect-community
Title
# prefect-community
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:
Copy code
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:
Copy code
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
Copy code
from prefect.executors import LocalExecutor

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