Hi, If I have two tasks in a flow that have no int...
# ask-community
j
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
Hi - you won't get concurrency calling flow.run in local mode by default ...
j
How about in server mode? How do I make it run concurrently? Can't seem to find documentation on that.
m
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
Thank you. WIll take a look!
LocalDaskExecution works perfectly. Thank you.
👌 3