Message365259
```
from concurrent.futures import ThreadPoolExecutor
from time import sleep
def wait_on_future():
sleep(1)
print(f.done()) # f is not done obviously
f2 = executor.submit(pow, 5, 2)
print(f2.result())
sleep(1)
executor = ThreadPoolExecutor(max_workers=100)
f = executor.submit(wait_on_future)
executor.shutdown(wait=True)
print(f.done()) # True
print(f.result()) # raise errror: cannot schedule new futures after shutdown
# print(f.exception())
```
Actually `executor.shutdown(wait=True)` works, it really wait f to be done. |
|
Date |
User |
Action |
Args |
2020-03-29 15:18:22 | gaoxinge | set | recipients:
+ gaoxinge, fireattack |
2020-03-29 15:18:22 | gaoxinge | set | messageid: <1585495102.16.0.626178232921.issue40093@roundup.psfhosted.org> |
2020-03-29 15:18:22 | gaoxinge | link | issue40093 messages |
2020-03-29 15:18:22 | gaoxinge | create | |
|