3 Jan
2020
3 Jan
'20
6:08 p.m.
Having a way to clear the queue and then shutdown once existing jobs are done is a lot more manageable. ... So the only clean way to do this is cooperative: flush the queue, send some kind of message to all children telling them to finish as quickly as possible, then wait for them to finish.
I was personally thinking of an implementation like that, cancel all still in pending and if wait is true the wait for the ones running, for both implementations. I didn't actually meant terminate literally, I just called it that as that's what multiprocessing.dummy.Pool.terminate (+ join after) does.