https://prefect.io logo
j

Jasono

10/18/2020, 11:40 PM
Hi, If I have two tasks in a flow that have no interdependency, how do I make them run concurrently? For instance, this seems to cause task2 to wait until task1 finishes although task2 isn't dependent on task1.
Copy code
with Flow('') as flow
r=task1()
r2=task2()
task3(r)

flow.run()
m

Marwan Sarieddine

10/19/2020, 12:11 AM
Hi - you won't get concurrency calling flow.run in local mode by default ...
j

Jasono

10/19/2020, 12:13 AM
How about in server mode? How do I make it run concurrently? Can't seem to find documentation on that.
m

Marwan Sarieddine

10/19/2020, 12:13 AM
the common approach is to make use a DaskExecutor
upvote 1
there is a LocalDaskExecutor option as well ... see https://docs.prefect.io/core/advanced_tutorials/local-debugging.html#localdaskexecutor for more details
upvote 1
j

Jasono

10/19/2020, 1:38 AM
Thank you. WIll take a look!
LocalDaskExecution works perfectly. Thank you.
👌 3
2 Views