Hi team! I have some code that runs a for loop over run_deployment, takes output prefect future and feeds that is the input to another task.
Expected behaviour
Prefect would schedule all the jobs (i.e not blocking) and when the result was available from each run_deployment in the 1st for loop, the relevant task woul be triggered
Actual behaviour
all the runs in the first loop need to be finished before the 2nd loop starts
Am i wrong about the expected behaviour? Or am i missing something
Copy code
futures=[]
for i in list:
future= run_deployment(name=deployment1)
futures.append(future)
for future in futures:
result = task(future)
s
Samuel Hinton
07/21/2024, 11:28 PM
normally to get a future instead of the return value youd use
.submit(name=deployment)
a
Arthur
07/23/2024, 1:13 PM
Ah sure. so if i don't do
.submit
, i return the output of the function directly, not a future, and the 2nd task shouldn't be blocked?
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.