Hello all! The tasks in a look are scheduled asynchronously, but is there a way to wait for previous task to finish before scheduling the pod for the next one? For example
Copy code
results = []
for i in range(10):
results.append(some_task(i))
Is there way to make the task at
i=1
wait for the task at
i=0
to finish? And I’d like it to work locally as well as remotely.
c
calm-pilot-2010
11/16/2023, 10:04 PM
I think you can do something like this.
Copy code
results = []
for i in range(10):
some_task_result = some_task(i)
if len(results) > 0:
results[-1] >> some_task_result
results.append(some_task_result)
I've done something similar to this before but I have not actually tested this code.