Andreas Nord
06/05/2023, 1:41 PM@flow
def test_flow():
for i in range(20):
task_res = test_task.submit(i)
if all_test_task_succeeded:
final_task()
Nate
06/05/2023, 6:46 PMmap
and wait_for
here like
In [6]: @task
...: def double(x: int) -> int:
...: return x*2
...:
In [7]: @task(log_prints=True)
...: def final():
...: print("all good!")
...:
...: @flow
...: def double_flow():
...: doubled = double.map([i for i in range(3)])
...:
...: final(wait_for=doubled)
Nate
06/05/2023, 6:50 PMfinal
would not run
if you want, you can add return_state=True
as a kwarg to the map
call to handle failures that occur while executing mapped tasks without failing the whole thingAndreas Nord
06/06/2023, 8:24 AM