5,321
edits
Line 351: | Line 351: | ||
return total | return total | ||
my_futures = [] | |||
for i in range(5): | for i in range(5): | ||
future = executor.submit(do_something, 1, 2+i) | future = executor.submit(do_something, 1, 2+i) | ||
my_futures.append(future) | |||
while len( | while len(my_futures) > 0: | ||
future = | future = my_futures.pop() | ||
future.result() | future.result() | ||
executor.shutdown() | executor.shutdown() |