jcozar
01/02/2025, 4:18 PM.submit
for the terminal futures?
2. Use .wait()
for terminal futures, and return a list of tasks states manually?
3. Use the wait
utilities to resolve terminal futures?Fabien Punin
01/02/2025, 4:29 PMfor future in futures:
future.result()
William Jamir
01/02/2025, 4:54 PMNate
01/02/2025, 4:56 PM.submit
and .map
are always sync, regardless of the underlying decorated functions
2. we will not proactively go find and wait for futures in cases where you do not
⢠pass the future to another task
⢠return
it explicitly
so if you're passing your futures to another task, or returning your terminal futures from your flow, nothing should change
1. Do not usefor the terminal futures?.submit
.submit
is a method on a task. so if you call my_task.submit(...)
the result of that call is a future. if you don't pass that future to another task or return
it from your flow before you exit the scope of the flow, then python will garbage collect your future (in keeping with concurrent.futures
behavior)
1. Usethis is valid if this is what's most convenient for your case, though you don't have to return anything,for terminal futures, and return a list of tasks states manually?.wait()
.wait()
is an escape hatch to make sure your futures resolve before moving on (even if you don't want to return anything)
1. Use thesame as above let me know if that doesn't answer your questionutilities to resolve terminal futures?wait
Nate
01/02/2025, 4:56 PMjcozar
01/02/2025, 5:14 PMNate
01/02/2025, 6:18 PMjcozar
01/03/2025, 8:34 AM